a zine about getting found — issue 01
filed under: home / blog / table of contents in wordpress: the seo version
note · WordPress · published · updated

Table of Contents in WordPress: the SEO Version

Short answer

Add a WordPress table of contents as a linked list of the page's main H2 and H3 sections. Use a maintained plugin, a block or manual fragment links. The primary benefit is navigation for readers; Google may generate search-result links automatically, but a TOC does not guarantee them or a ranking increase.

  • Fix the heading hierarchy before generating the TOC.
  • Give every linked section a unique, stable anchor ID.
  • Keep link labels identical or very close to the visible section headings.
  • Use a semantic navigation label so assistive technology can identify the TOC.
  • Test links, keyboard focus, mobile layout and page weight.
  • Do not add structured data solely to create a TOC or jump links.

Does a table of contents help SEO?

A TOC can make a long page easier to scan and navigate. Google also recommends organizing content with clear paragraphs, sections and headings because that helps readers. Those are valid usability and information-architecture benefits.

The stronger claims are not supported. Google does not say that adding a TOC reduces bounce rate, raises rankings or guarantees jump links. Featured snippets and other search presentations are selected automatically. Google also says there is no requirement to split content into small chunks for its generative Search features.

Treat the TOC as navigation. Measure user behavior and Search appearance after implementation rather than assigning it an assumed SEO uplift.

Which headings should appear in the TOC?

Include the sections a reader needs to understand the page:

  • usually H2 sections;
  • selected H3 subsections when they add useful detail;
  • no decorative labels or repeated CTA headings;
  • no H1, because the page title is already the document’s top-level heading.

Keep the document hierarchy logical even if the TOC displays only two levels. Do not change a heading level merely to make the TOC look more compact.

Option 1: use a WordPress TOC plugin

A plugin is the practical choice when editors publish frequently and need automatic updates. Current WordPress directory options include:

Plugin availability, compatibility, ratings and features can change. Check the current WordPress directory page, supported WordPress version, update history and support forum before installation. Test the output rather than relying on an “SEO-friendly” label.

Plugin QA checklist

  1. Confirm that IDs remain stable after editing a heading.
  2. Check that duplicate headings receive unique IDs.
  3. Verify that excluded headings are truly excluded.
  4. Test the collapsed state with keyboard controls and screen readers.
  5. Measure added CSS and JavaScript on pages without a TOC.
  6. Check mobile wrapping for long section titles.

Option 2: add a manual TOC

For a stable page with a few sections, manual fragment links are simple and add no JavaScript. In the block editor, add a Custom HTML block for the navigation and set the corresponding HTML anchor in each heading block’s advanced settings.

<nav aria-labelledby="contents-heading">
  <h2 id="contents-heading">Contents</h2>
  <ul>
    <li><a href="#seo-impact">Does a TOC help SEO?</a></li>
    <li><a href="#plugin-option">WordPress TOC plugins</a></li>
    <li><a href="#manual-option">Manual anchor links</a></li>
  </ul>
</nav>

<h2 id="seo-impact">Does a TOC help SEO?</h2>

Use short lowercase IDs with hyphens, and do not change them casually after the page has been shared or indexed. If an ID must change, update every internal link that points to it.

Option 3: build it in the theme

Theme-level generation is appropriate when the site needs one controlled design across many posts. Use an HTML parser or WordPress block data rather than a regular expression over arbitrary post HTML. A regex can mishandle nested markup, duplicate headings, inline links and encoded characters.

Implement theme changes in a child theme or custom plugin so a parent-theme update does not overwrite them. The generated markup should:

  • preserve the original heading content;
  • assign unique IDs to the heading elements themselves;
  • escape displayed text and attributes;
  • avoid generating an empty TOC;
  • support editor exclusions;
  • remain usable without JavaScript.

How to validate a WordPress TOC

Open the rendered page, not only the editor preview. Click every entry and confirm that the correct heading is targeted. Then check:

  • one H1 and a coherent H2/H3 hierarchy;
  • no duplicate IDs;
  • no links to missing fragments;
  • visible keyboard focus;
  • enough scroll margin below a sticky header;
  • no horizontal overflow at mobile widths;
  • no layout shift when a collapsible TOC opens;
  • acceptable CSS and JavaScript cost.

Also review the page after changing a heading. Automatic plugins may regenerate IDs, while hand-authored links can become stale.

Google may show links to sections or send a user directly to a relevant passage, but publishers cannot mark a page to force a featured snippet. Clear headings and anchors provide useful navigation; the final Search presentation remains Google’s decision.

No special TOC schema is required. Keep any structured data accurate and relevant to the page type rather than adding markup to chase an unsupported TOC feature.

Sources

WordPress TOC FAQ

How do I add a table of contents in WordPress?
Use a maintained TOC plugin or block for automatic generation, or create a manual list of links to unique heading IDs. Validate the rendered page after implementation and after changing headings.
Does a table of contents improve rankings?
There is no guaranteed ranking benefit. A TOC can improve navigation on a long page, while clear headings help readers understand its structure. Measure the result instead of assuming a direct ranking effect.
Do I need a plugin?
No. A manual anchor list works well for stable pages. A plugin is more maintainable when many editors publish long articles and headings change frequently.
Why is Google not showing section links?
Google selects search-result presentations automatically, and valid anchors do not guarantee section links. Keep the page useful, indexable and well structured, then monitor the actual result instead of repeatedly changing IDs.
Dima Mochalov, SEO & AEO Specialist
Dima Mochalov
SEO & AEO Specialist · 9+ years · Head of SEO, Marketing Bear (Dubai)
written by a human who ranks things
About the author

Be the answer, not a footnote.

reply is fast — it’s just me here
iNevidimka — Dima MochalovPrivacy · Terms · Editorial · Methodology · © 2026
Operated by Mochalov Dmitri Andrei IE (Individual Entrepreneur (Armenia)) · Reg. 20268705 · Arghishti str. 7, suite 0015, Yerevan, Kentron, Armenia · +1 (352) 665-8350 · Google Maps. All engagements are governed by our Terms of Service.