Hi @jlwp123 ,
Thanks for the suggestions!
About renaming the shortcode parameter start to something like minimum / minimum-headings — I agree that would be more descriptive. However, changing an existing shortcode parameter could cause backward compatibility issues for sites already using [toc start=”…”].
That said, I’ve shared this as a feature request with our team (as an additional/alias parameter) so it can be considered in a future update.
Regarding showing/hiding the TOC per page — this can already be done using the built-in shortcodes:
- If you want the TOC on specific pages only, you can add it manually using [toc].
- If you want to hide it on a specific page/post, you can use [no_toc].
Thanks again for taking the time to share the ideas, and feel free to reach out if you have any other suggestions!
Thread Starter
Jlwp
(@jlwp123)
@shivamtyagi – Thanks for your reply. I do realize that removing “start” would break backwards compatitibility. I meant for the addition of eg “minimum-headings”.
As for “show or hide the TOC” I should have explained more clearly. You interpreted this to mean to show or hide the whole plugin ie that there is no TOC shown at all and therefore there is no option to show or hide the TOC.
But this is not what I mean – what I mean is to show the TOC in a page but be able to select to show the table of contents links either hidden or shown state. IE to select whether the “Show” or “Hide” feature has been activated.
The reason for this is SEO – If the TOC is at the top of the page and there are many entries in the TOC then the TOC pushes down the main content of the page below the fold (off screen) which is not good for SEO purposes. Best in this case to show the TOC initially hidden. If the TOC has only a few entries, then show the entries right away on page load. To be more clear what i mean is to add a parameter to the shortcode eg show-hide=hidden or show-hide=show. I hope this is more clear.
And I have another suggestion – If the TOC has a long list of contents ie many links, then this pushes down the content and this is not good for SEO purposes. One way to avoid this is for the TOC to appear over the contents – I successfully achieved this with your plugin using simple css including eg
z-index: 999;
But I abandoned this because then I would need the plugin to show a small icon instead of “Contents [show]” to press and i did not know how to do this.
Hi @jlwp123 ,
Thanks for the clarification!
At the moment, TOC+ includes the Show/Hide toggle, but it doesn’t provide a shortcode attribute to control the default open/closed state per page. I’ve shared this as a feature request with our team so it can be considered for a future update.
Regarding the overlay TOC idea using z-index — that’s a valid approach via CSS, but switching the “Contents [show]” to an icon/button would require additional customization (or a plugin enhancement). I’ve shared that feedback as well.
Thanks again for the great suggestions!