Template:TOC limit

.toclimit-2 .toclevel-2, .toclimit-3 .toclevel-3, .toclimit-4 .toclevel-4, .toclimit-5 .toclevel-5, .toclimit-6 .toclevel-6, .toclimit-7 .toclevel-7 { display: none; } 

Usage
This template inserts a table of contents that limits subheadings lower than a certain level. This helps keep the table of contents short and no cluttered. To use it, type:

For example,   allows headings with =, == and ===, but nothing further, like =====. This can be seen below:

Example