How to Add a Table of Contents to WordPress (2026 Guide)

Add a table of contents to WordPress — laptop showing a blog article with a table of contents sidebar

Long articles are hard to scan. A reader lands on your post, sees a wall of text, and leaves before finding the one section they actually need. Learning how to add a table of contents to WordPress fixes that in minutes: a clickable list of your headings near the top of the post that lets visitors jump straight to the answer they came for.

It is not just a reader convenience. Google can surface your headings as jump links in search results. This guide covers four ways to add a table of contents to WordPress — the free Rank Math block, Easy Table of Contents, Elementor, and manual anchor links.

What Is a Table of Contents in WordPress?

A table of contents is a short list of links built from the headings in your post. Each item points at one section, and clicking it scrolls the reader straight there. You have seen one on nearly every long guide: a small boxed list after the introduction, usually titled “Table of Contents”. WordPress does not add one by default — you need a block, a plugin, a widget, or a few lines of HTML.

Why Add a Table of Contents to Your Posts?

Readers find answers faster. Most visitors do not read a post top to bottom. They scan the headings and jump to the section that covers their problem. A table of contents turns that scan into one click.

Google sometimes shows jump links beneath a search result, letting searchers skip directly to a section of your page. Those links come from your headings. It is not a ranking factor on its own, but a result with jump links takes up more space and earns more clicks.

Before You Start: Is Your Post Ready for One?

Not every post needs one. Rule of thumb: if your article has four or more H2 sections, add one. Below that, the list is clutter.

Your headings also need to be real headings. A table of contents is built from Heading blocks, not from bold paragraphs styled to look like headings. Check the structure first: one H1 only, H2 for each main section, H3 for subsections, and no skipped levels.

Method 1: Add a Table of Contents to WordPress with Rank Math

If you already run Rank Math, this is the fastest route — the Table of Contents block is included free. If you have not set Rank Math up yet, start with my Rank Math setup guide first.

One requirement: the block needs Rank Math’s Schema module enabled — switch it on under Rank Math SEO → Dashboard. The block works only in the block editor, not in the Classic Editor or Elementor.

  1. Open the post and place your cursor right after the introduction.
  2. Click the + block inserter, type Table of Contents, and select Table of Contents by Rank Math (or type /table on an empty line).
  3. Add a title such as “Table of Contents”. Rank Math builds the list from your headings immediately.
  4. In the block settings sidebar, tick or untick heading levels so only the ones you want appear — H2 and H3 for most posts. Click the eye icon next to any heading to hide it, or click a link’s text to shorten a long heading.

Rank Math adds the anchor links automatically, and it also adds SiteNavigationElement schema for the headings in the block. Add the block once per post — two tables of contents on one page confuse readers. Rank Math’s own documentation covers the block in detail: How to Add Rank Math’s Table of Contents Block.

Method 2: Easy Table of Contents (Auto-Insert for Every Post)

The Rank Math block covers one post at a time. To cover dozens of older posts without opening each one, use Easy Table of Contents — over 600,000 active installs, rated 4.4 out of 5, version 2.0.89 tested up to WordPress 7.0.

  1. Go to Plugins → Add New, search for Easy Table of Contents, then install and activate it.
  2. Open Settings → Table of Contents.
  3. Under Auto Insert, tick Posts (and Pages if you want them too).
  4. Set the position to Before first heading and choose which heading levels to include.
  5. Enable Smooth Scroll, and set Show when to a minimum of four headings so short posts stay clean.
  6. Save, then open any old post and confirm the list appears.

Prefer to place the list by hand? Drop the shortcode where you want it:

[​ez-toc]

For a quick comparison of the main plugins before you commit, this roundup is worth a read: 9 Best WordPress Table of Contents Plugins Compared.

Method 3: Elementor Table of Contents Widget

If you build in Elementor, the cleanest option is its own Table of Contents widget — an Elementor Pro widget. Drag it onto your page after the intro and it builds the list from your headings automatically.

The widget lets you choose which heading tags to include (H1 to H6), adds smooth scrolling and a collapsible toggle, and can stay fixed in place while the reader scrolls. It also highlights the active section as the reader moves down the page.

On Elementor Free, use a free addon widget instead — Master Addons includes one that works with Elementor Free. Or use Method 4 below: anchor links work in any builder, as long as each heading has an ID.

Method 4: Build a Table of Contents Manually with Anchor Links

No plugin, no block, no widget — just HTML. The manual method is the lightest option, and it works everywhere.

Step 1: Give every heading an anchor. In the block editor, select a Heading block, open the Advanced panel in the block settings sidebar, and type an anchor in the HTML anchor field — for example speed-tips. In Elementor, set the same value as the Heading widget’s CSS ID under the Advanced tab. Keep anchors lowercase, hyphenated, and unique on the page.

Step 2: Build the list. Add a List block (or an HTML widget in Elementor) right after your introduction, and link each item to its anchor with a # in front:

<ul>
  <li><a href="#speed-tips">Speed Tips</a></li>
  <li><a href="#caching">Caching</a></li>
  <li><a href="#images">Image Optimization</a></li>
</ul>

Step 3: Test every link. Click each item and confirm it lands on the right section. A single typo in an anchor — one missing hyphen — breaks that link silently, so test before you publish. The trade-off is maintenance: rename a heading and you update its link by hand.

Table of Contents Best Practices

Show H2 and H3 only. Deeper levels turn the list into a second copy of the article. Hide H4 and below unless the post genuinely needs them.

Place it after the introduction, never above it. Readers need a sentence or two of context first before they choose a section.

Fix the sticky-header jump. If your theme has a sticky header, anchor jumps can land with the heading hidden behind it. Add this CSS in the Customizer under Additional CSS:

h2, h3 {
  scroll-margin-top: 90px;
}

Troubleshooting: Table of Contents Problems and Fixes

The list is empty. Your headings are probably bold paragraphs, not real Heading blocks. Change each one to a Heading block. In Rank Math, also confirm the Schema module is enabled.

Links jump to the wrong spot. Two headings share the same anchor, or a heading was renamed after the list was built. Make every anchor unique.

Frequently Asked Questions

Does a table of contents help SEO?

Indirectly, yes. It is not a ranking factor on its own, but it improves the signals that matter: readers find answers faster and stay longer, and Google can show jump links under your result. If you want to go further with structured data, my guide on adding FAQ schema to WordPress is a good next step.

Can I add a table of contents to old posts without editing each one?

Yes. Install Easy Table of Contents, tick Posts under auto-insert, and the list appears on every post with enough headings — no per-post editing.

Do I need a plugin to add a table of contents?

No. The manual anchor method needs no plugin at all. WordPress has shipped an experimental core Table of Contents block since 2022, but it does not appear on a default install. For most sites, the Rank Math block you already have is the simplest answer.

Conclusion

Adding a table of contents to WordPress is a ten-minute job: readers reach their answer in one click, and Google gets a clearer map of what each section covers. If you already run Rank Math, use its free block. If you need it on every post at once, use Easy Table of Contents. If you build in Elementor, the Pro widget — or the manual anchor method — covers you.

Pick one method, add it to your longest post today, and click every link before you publish. And if your WordPress site needs more than a table of contents, get in touch through my contact page and tell me what you are building.