Hello,
We apologize for the issue you are facing. Currently, Rank Math does not provide a built-in option to limit the number of items displayed in the Table of Contents (TOC) with a ‘Show More’ button in either the free or pro version. The TOC settings allow customization such as excluding specific headings or changing the list style, but they do not include functionality for expanding or collapsing sections.
If you want to implement a similar feature, it may require custom coding or additional plugins that support this functionality.
Regarding your question about applying this globally, the TOC settings are generally managed on a per-post or per-page basis. You can customize the TOC for each post individually, and while you can use custom CSS to style it, there isn’t a global setting for limiting the display of TOC items.
Thank you for raising this concern! If you have further questions or need assistance with anything else, feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Hello,
Thank you for your previous response! I understand that Rank Math does not natively support limiting the number of displayed items in the Table of Contents (TOC) with a “Show More” button.
In your response, you mentioned that this functionality can be achieved using a plugin. Could you please recommend a specific plugin that works well with Rank Math and supports this feature?
Additionally, I would like to suggest that it could be a useful feature to allow users to set a limit on how many TOC items are shown by default (e.g., 3 or more), with the option to expand further. This would be particularly helpful for longer posts with many headings, as the TOC can become very long and overwhelming for readers.
I would appreciate your help in guiding me to the right solution for expanding and collapsing TOC items.
Thank you for your assistance!
Best regards,
Hello,
To achieve that, you may use and customize this to your TOC here:
https://rankmath.com/kb/table-of-contents-block/#make-the-table-of-contents-collapsible
Unfortunately, we don’t provide custom code snippets beyond the ones we already have in our documentation
If you’re facing difficulties with implementation, please consult your developer for assistance in incorporating the custom code.
Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.