Title: Register shortcode generating TOC
Last modified: March 15, 2025

---

# Register shortcode generating TOC

 *  Resolved [codade](https://wordpress.org/support/users/codade/)
 * (@codade)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/register-shortcode-generating-toc/)
 * Hi,
 * I just installed Rank math and tried to get my toc recognised, which is generated
   by a shortcode-function. This function also reads headings generated through 
   other shortcodes from the post and outputs a html-div with its own id and class,
   similar to the rank-math-toc. I found your page about TOC and the code snippet
   to register other TOC plugins. Is there also a way to tell your plugin, that 
   it should use the contents or what kind of information and in what format (json/
   html) is needed to get the info of the TOC into the schema?
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fregister-shortcode-generating-toc%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/register-shortcode-generating-toc/#post-18364577)
 * Hello [@codade](https://wordpress.org/support/users/codade/),
   Rank Math doesn’t
   automatically enable SiteNavigationElement schema for custom TOCs. However, you
   can customize our schema using this filter: [https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data](https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data)
   If you’re using Rank Math PRO, you can manually create the JSON format and import
   it via our schema importing tool. Here’s an example structure:
 *     ```wp-block-code
       {  "itemListElement": [    {      "@context": "https://schema.org",      "@type": "SiteNavigationElement",      "@id": "#rank-math-toc",      "name": "I. Introduction",      "url": "http://rm-pro.local/why-computers-arent-perfect/#i-introduction"    },    {      "@context": "https://schema.org",      "@type": "SiteNavigationElement",      "@id": "#rank-math-toc",      "name": "II. Historical Context of Computer Development",      "url": "http://rm-pro.local/why-computers-arent-perfect/#ii-historical-context-of-computer-development"    },    {      "@context": "https://schema.org",      "@type": "SiteNavigationElement",      "@id": "#rank-math-toc",      "name": "A. Early Innovations and Limitations",      "url": "http://rm-pro.local/why-computers-arent-perfect/#a-early-innovations-and-limitations"    },    {      "@context": "https://schema.org",      "@type": "SiteNavigationElement",      "@id": "#rank-math-toc",      "name": "B. Evolution of Computing Technology",      "url": "http://rm-pro.local/why-computers-arent-perfect/#b-evolution-of-computing-technology"    },        ...etc  ]}
       ```
   
 * Here’s a guide you can follow: [https://rankmath.com/kb/import-schema-markup/](https://rankmath.com/kb/import-schema-markup/)
   
   Hope that helps.
 *  Thread Starter [codade](https://wordpress.org/support/users/codade/)
 * (@codade)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/register-shortcode-generating-toc/#post-18392064)
 * Thank you for your help!
 * The filter to extend the existing json-ld was the thing I was searching for and
   I was able to get my TOC working with your plugin.
 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/register-shortcode-generating-toc/#post-18394893)
 * Hello [@codade](https://wordpress.org/support/users/codade/),
    You’re very welcome!
   Glad to hear you got it working. If you need any further assistance, feel free
   to reach out.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Register shortcode generating TOC’ is closed to new replies.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/register-shortcode-generating-toc/#post-18394893)
 * Status: resolved