But is there a way I can show only restrict the TOC to show only h2 tags or just h2 and h3 tags not those after them like h4, h5, and h6
I’m afraid not. The only way is to edit the source code.
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!