How to Create a Table of Contents in WordPress (2 Simple Methods)

Do you want to know how to create a table of contents in WordPress?

Creating a table of contents (ToC) in WordPress can be tricky if you’re a beginner. Even if you’re an expert, using WordPress’ default method can rob you of a few precious minutes you could spend doing other productive things.

In this article, we’ll show you how to automatically create a table of contents in WordPress and easily customize it to save you time.

Why is a Table of Contents Important in WordPress?

A table of contents helps users easily navigate your post, enhancing the user experience (UX). Most readers simply want to jump to the section with the answer they’re looking for, and a Table of Content helps them do that.

Another benefit of a table of contents is that it helps you drive up your clickthrough rates (CTR) in SEO. Articles with a table of contents are more engaging and interactive on search engine results pages (SERPs) because they are enhanced by jump links.

Knowing how to create a table of contents is important as it has many SEO benefits.

Jump links are an excellent way to encourage visitors to click on your website and go straight to the section they’re most interested in. The high CTR signals to search engines that users find your content valuable, and as a result, your SEO rankings improve.

Another advantage of tables of contents is that they can help you land the coveted featured snippet to get you maximum SEO traffic.

A table of contents can help you land the featured snippet.

Search engines often pull listicle-based snippets of content to display as the featured snippet. The main reason is that lists (like tables of contents) and bullet points can clearly and concisely communicate answers to users’ questions.

How to Create a Table of Contents in WordPress

The biggest challenge with creating a table of contents in WordPress is that it can take a lot of time to manually add jump links.

Luckily, there is a way that allows you to automatically add a table of contents in WordPress and even customize the headings.

In this tutorial, we will cover both methods on how to automatically create a table of contents in WordPress using a plugin as well as how to manually create a table of contents using code.

With that said, let’s jump right in.

Method 1: How to Automatically Create a Table of Contents in WordPress

The easiest way to automatically create a table of contents in WordPress is by using the Table of Contents feature in All in One SEO plugin.

AIOSEO is one of the best WordPress SEO plugins in the market, used by over 3 million website owners. Aside from dozens of powerful SEO features, it also comes with an advanced Table of Contents block that lets you automatically create a table of contents in WordPress.

AIOSEO is one of the best SEO plugins on the market.

The first thing you need to do is install and activate the AIOSEO Pro plugin. For detailed instructions, please see our step-by-step guide to installing AIOSEO.

Once you have installed and set up the plugin, you’re now ready to add a table of contents in WordPress.

Step 1: Add the AIOSEO -Table of Contents Block

To add a table of contents to your blog post, all you have to do is open the WordPress content editor and then click the Add block button.

Next, you need to select the AIOSEO – Table of Contents block:

To add a ToC using a table of contents block, click the Add block button and select the AIOSEO - Table of Contents block.

Once you click on the AIOSEO – Table of Contents block, it will automatically create a table of contents block with all your subheadings.

The Table of Content blocks helps you automatically create a table of contents on your posts.

Step 2: How to Customize Your Table of Contents

Not only does the Table of Contents block saves you time by automatically generating a table of contents, but it also has powerful customization features. For example, you can:

  • Customize the heading text in the table of contents
  • Choose to hide and re-order headings inside the Table of Contents block
  • Customize the table of contents anchors

To customize your table of contents, you need to click on the block’s options menu.

You can customize your table of contents using the block settings.

From here, you can choose to reorder items in the table of contents or hide certain items.

You’ll find other Table of Contents block customization options in the editor’s sidebar:

You can also customize your ToC by using the block options in the sidebar.

Here, you can change the list style and other advanced design settings.

Once you’re done customizing your table of contents, make sure to save your draft, and that’s it!

Congrats, you’ve successfully added a table of contents in WordPress.

Method 2: How to Manually Create a Table of Contents in WordPress

If you don’t want to use a table of contents plugin in WordPress, then you can also manually create a table of contents in WordPress. However, the process can be very time-consuming.

Let’s take a look at the manual steps.

Step 1: Create HTML Anchors

The first step is to add HTML anchors to your header tags or subheadings. These HTML anchors will serve as internal links that you’ll use to link your various content subheadings in your table of contents.

To get started, click on any subheading in the content editor.

Next, go to the Block settings in the sidebar and scroll down to the Advanced section. Then, type in your tag in the HTML anchor field.

Knowing how to create a table of contents in WordPress involves adding HTML anchors to your heading tags.

Your HTML anchor should be similar to your subheading. This will help you remember the HTML anchor associated with each subheading.

Step 2: Create a Table of Contents Using a Regular Content Block

Once you’ve created your HTML anchors, you can now create your table of contents.

First, add a Paragraph block where you want to display your table of contents and title it accordingly.

Next, add a List block where you’ll list all your subheadings. You can either type them out or copy and paste them.

Create a table of contents by adding a paragraph entitled "Table of Contents" and then list your subheads under it.

This will serve as your table of contents.

Step 3: Link Your Sub-headings inside the Table of Contents

Once you’re done creating your table of contents listing, the next step is to link it to your subheadings using the HTML anchors you created.

To do that, highlight a list item in the table of contents and click on the Link icon.

Type in the HTML anchor and make sure to precede it with a hashtag (#).

Next, type in the HTML anchor corresponding to the subheading you’re linking to and make sure to precede it with a hashtag (#). Once done, click on the Enter icon (or hit Enter on your keyboard), and the HTML anchor will be added to your table of contents list.

Repeat the process for the rest of the items on your table of contents.

As you’ll notice through the process, if your table of contents is long, then this can be quite time-consuming. That’s why we always recommend using our Table of Contents block.

We hope this article has helped you know how to add a table of contents in WordPress easily. Once you’re done, you may also want to check out some of our tutorials. A great example is our guide on how to add an FAQ section in WordPress. You may also want to check out our ultimate link building guide.

Want to Try AIOSEO for Free?

Enter the URL of your WordPress website to install AIOSEO Lite.

Please enable JavaScript in your browser to complete this form.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.

author avatar
Kato Nkhoma Content Writer
Kato is one of those rare unicorns born with a pen in his hand—so the legend says. He’s authored 2 books and produced content for hundreds of brands. When he’s not creating content for AIOSEO, you’ll find him either watching tech videos on YouTube or playing with his kids. And if you can’t find him, he’s probably gone camping.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

4 comments on “How to Create a Table of Contents in WordPress (2 Simple Methods)

  1. WordPress is one of the most usable CRM nowadays and it is quite hard to find really valuable information about WordPress templates. However your list is great and full of good themes. It also would be a great plus if you can add some popular templates from such marketplaces such as TemplateMonster
    or ElegantThemes