How to Add a Table of Contents in WordPress (2 Easy Ways)

How to add a table of contents in WordPress

Long posts lose readers who cannot find the part they came for.

A table of contents fixes that. It lists the sections of your post at the top, and each line is a link that jumps straight to that section.

This guide shows you how to add a table of contents in WordPress two ways: automatically with a free block, and manually with no plugin at all.

Quick answer

WordPress does not include a table of contents block (checked on WordPress 7.1). The easiest way to add one is the free Table of Contents block from Ultimate Blocks:

  1. Go to Plugins > Add Plugin, search for Ultimate Blocks, then install and activate it.
  2. Open your post, type /table of contents below the introduction and press Enter.
  3. The block builds the list from your headings and keeps it updated. Click Save.

No plugin? Give each heading an HTML anchor, then link to it from a list with a # in front of the anchor name.

The box below is a live Ultimate Blocks Table of Contents block, built from the headings in this post. Click any line to try it.

What is a table of contents in WordPress?

A table of contents (often shortened to TOC) is a clickable list of the headings in a post or page. Each item is an anchor link that takes the reader to that section.

It is most useful on:

  • Long tutorials and how-to guides
  • Roundups and comparison posts
  • Documentation and knowledge base articles
  • Pillar pages that cover a topic from start to finish

A short post with two or three headings usually does not need one.

Which method should you use?

MethodBest forPlugin needed?Updates when you edit headings?
Method 1: Ultimate BlocksMost block editor users, any post lengthYes (free)Yes, automatically
Method 2: Manual (no plugin)One or two short postsNoNo, you update every link yourself
Checked against WordPress 7.1 and the Ultimate Blocks docs in November 2026.

Our pick: use Method 1 unless you only need a table of contents once. The manual method works, but every renamed heading means a broken link to fix.

Method 1: Add a table of contents with Ultimate Blocks (free)

Best for: anyone using the block editor who wants a table of contents that builds and updates itself.

Ultimate Blocks is a free block plugin active on 50,000+ WordPress sites, rated 4.9 out of 5 from 700+ reviews on WordPress.org. Its Table of Contents block reads your headings, gives each one an anchor and builds the clickable list for you.

Step 1: Install Ultimate Blocks

  1. In your WordPress dashboard, go to Plugins > Add Plugin.
  2. Search for Ultimate Blocks.
  3. Click Install Now, then Activate.

Step 2: Add the Table of Contents block

  1. Open the post or page in the block editor.
  2. Click where the list should go. Right after the introduction works best.
  3. Type /table of contents and press Enter, or click the + (Block Inserter) button and search for Table of Contents.
  4. The block fills in from your headings straight away. If the post has no headings yet, add them and the list appears.

Step 3: Choose which headings to show

  • Allowed Headings: in the block sidebar, tick the heading levels to include, from H1 to H6. Most posts work best with H2 and H3 only.
  • Shorten an entry: click the pencil icon next to it and type new text. The heading on the page does not change.
  • Hide an entry: click the trash icon next to it. The heading stays on the page.
  • Rename the title: click the block title and type your own, such as “In this guide”, or clear it to show no title.

Step 4: Style it and set up scrolling

Select the block and use the block sidebar:

  • Layout: show one, two or three columns, as a bulleted, numbered or plain list.
  • Collapsible: let readers show or hide the list, choose whether it starts open, and start it closed on phones.
  • Scroll: turn on smooth scrolling and set a scroll offset so a sticky header does not cover your headings.
  • Styles tab: change font sizes, title and list colors, border, padding and spacing.

Click Save and open the live post to test a few links. The Table of Contents docs explain every setting.

Add a sticky table of contents (Pro)

On very long guides, readers forget the list once they scroll past it. Ultimate Blocks Pro adds a sticky table of contents, a floating button that opens the list from anywhere on the page, plus icons in place of bullets. Plans start at $39 a year for one site, and every plan has a 30-day money-back guarantee.

See the steps in our guide to adding a sticky table of contents.

Method 2: Create a table of contents manually (no plugin)

Best for: a single short post where you do not want to install anything.

WordPress has no table of contents block, but every heading has an HTML anchor field. You can use it to build a list of jump links by hand.

Step 1: Add an HTML anchor to each heading

  1. Click a heading in your post.
  2. In the block sidebar on the right, open the Advanced panel. If the sidebar is hidden, click the Settings icon at the top right.
  3. Type a short, unique name in HTML anchor, such as pricing. Use hyphens, not spaces.
  4. Repeat for every heading you want in the list.

Step 2: Make a list of your sections

Below your introduction, type /list and press Enter to add a List block. Add one item for each heading, in the same order as the post. Our guide to bullet points and numbered lists covers list styling.

  1. Select the text of a list item.
  2. Click the Link icon in the toolbar, or press Ctrl+K (Cmd+K on a Mac).
  3. Type # followed by the anchor name, such as #pricing, and press Enter.
  4. Repeat for each item, then click Save.

Downside: nothing updates for you. If you rename a heading or add a new section, you must update the anchor and the list yourself.

Other table of contents plugins

If you use the Classic Editor or a page builder, or want a table of contents added to every post automatically, these plugins are also active and maintained:

PluginBest forFree versionWorks withLast updated
Ultimate BlocksBlock editor users who want a TOC block plus other content blocksYes (sticky TOC in Pro)Block editorNov 8, 2026
Easy Table of ContentsAdding a TOC to every post automatically, including page buildersYes (block and sticky TOC in Pro)Classic Editor, block editor, Elementor, Divi, WPBakeryNov 16, 2026
Table of Contents PlusSet-and-forget automatic TOC on long postsYesAny editor (auto insert)Sep 17, 2026
Rank Math SEOSites that already use Rank MathYes (TOC block is free)Block editorNov 10, 2026
Heroic Table of ContentsA simple, single-purpose TOC blockYesBlock editorSep 14, 2026
Install counts, ratings and update dates checked on WordPress.org on November 21, 2026.
  • Easy Table of Contents is active on 600,000+ sites. It inserts a table of contents automatically by post type, and works with the Classic Editor and major page builders.
  • Table of Contents Plus is active on 200,000+ sites. It adds a table of contents to every long post once a post has enough headings, with no block or shortcode to insert.
  • Rank Math SEO includes a free Table of Contents by Rank Math block for the block editor. It needs the Schema module turned on.
  • Heroic Table of Contents is active on 5,000+ sites and offers four built-in styles.
  • Yoast SEO users: the Yoast table of contents block is part of Yoast SEO Premium, not the free plugin.

We compare more options in our list of the best table of contents WordPress plugins. Want the list in your sidebar instead? See how to add a table of contents in the WordPress sidebar.

Where should you put a table of contents?

  • After the introduction: readers see what the post covers before they start scrolling. This is the most common spot.
  • Before the first H2: keeps the intro short and puts the list where the main content begins.
  • In a sticky button or sidebar: best for very long guides, so the list is always one click away.

Avoid placing it at the very bottom of a post, where few readers will see it.

Does a table of contents help SEO?

A table of contents is not a direct ranking factor, but it helps in three practical ways:

  • Readers find answers faster, which makes long posts easier to use.
  • Google can show section links: jump links can help Google show “Jump to” links for your page in search results.
  • Clear structure: a list of descriptive headings shows search engines and AI assistants what each section covers.

For best results, write headings that describe the section clearly, and keep one H1 (your post title) with H2 and H3 headings below it. Good headings also make great targets for internal links.

Why is my table of contents not working?

  • The list is empty: the block lists your Heading blocks. Text that is only bold, not a heading, will not appear.
  • A heading is missing: check that its level is ticked under Allowed Headings, and that you did not hide it with the trash icon.
  • Links stop below the heading: a sticky header is covering it. Set a scroll offset in the block’s Scroll panel.
  • Manual links do nothing: anchors are case-sensitive, and the link needs a # while the HTML anchor field does not.
  • Changes do not show: save the post, then clear your cache and reload the page.

Related guides:

Supercharge Your WordPress Block Editor!

Black Friday deal: until December 2, 2026, use code BF2026 for 50% off Ultimate Blocks Pro, or get 40% off the full WP Block Suite bundle.

Frequently asked questions

Does WordPress have a built-in table of contents block?

No. WordPress 7.1 has no table of contents block in core. You can build one by hand with HTML anchors, or add one with a free block such as the Ultimate Blocks Table of Contents block.

Does the table of contents update automatically?

Can I add a table of contents without a plugin?

How do I hide a heading from the table of contents?

Is the Ultimate Blocks Table of Contents block free?

Can I add a table of contents to every post automatically?

Final thoughts

The fastest way to add a table of contents in WordPress is the free Ultimate Blocks Table of Contents block: add it once and it builds and updates the list from your headings. The manual HTML anchor method works too, but it is best saved for one or two short posts.

Your next step: open your longest post and add the Table of Contents block right after the introduction.

Found this helpful? See more of us on Google.

Add UltimateBlocks.com as a preferred source and our WordPress guides will show up more often in your Top Stories, AI Overviews and AI Mode.

Add us on Google

Free, one tap, remove anytime

Leave a Reply

Your email address will not be published. Required fields are marked *