Hello @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
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:
{
"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/
Hope that helps.
Thread Starter
codade
(@codade)
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.
Hello @codade,
You’re very welcome! Glad to hear you got it working. If you need any further assistance, feel free to reach out.