How to Create a Table of Contents in WordPress

How to Create a Table of Contents in WordPress (Plugin or Not)

Did you know that adding a table of contents to a webpage not only helps readers navigate, but it can improve search ranking as well? In this post, we’ll show you how to easily create a table of contents in WordPress posts and pages.

We’ll also tell you how a table of contents on a WordPress post can improve search engine optimization (SEO) and search rankings for that post.

Ready? Let’s get started.

Why Use a Table of Contents in WordPress?

A table of contents (ToC) serves several purposes, with benefits for readers and the site owner.

MonsterInsights is the best WordPress Analytics plugin. Get it for free!

First, readers can get an idea of the subjects that are covered in a longer post or webpage, without scrolling down to see all the content.

And, if you use links in your table of contents, users can jump right to those sections of the text. That’s a helpful navigation option for readers as well.

So, adding a table of contents to your WordPress page can improve user experience. What about SEO and your search engine rankings?

How a Table of Contents Can Boost SEO

When you include a table of contents in a long article or post, you’re probably adding more high-value keywords as well. Most ToCs also use links to help users navigate between the table of contents and the sections of text.

Adding keywords and internal links to your pages can potentially lead to higher rankings on search engines. Google may also use ToCs as a source for featured snippets in search results, which increases the number of people who click your webpage links.

Here’s an example of a featured snippet at the top of the search results:

Table of Contents Featured Snippet Google Search

Making a table of contents in a WordPress post doesn’t guarantee that you’ll get a featured listing. But it does give you a chance for this kind of ranking and visibility.

The Easy Way to Build a Table of Contents in WordPress

You can manually create a table of contents in a webpage by using HTML code. We’ll show you how later in this post.

However, let’s start by looking at the easiest way to do it in a WordPress site. The most efficient way to make a ToC in WordPress is to use a plugin.

In this tutorial, we’ll use the All in One SEO (AIOSEO) plugin to create a table of contents in a WordPress page.

AIOSEO

AIOSEO is the best SEO plugin for WordPress. It gives SEO beginners all the tools they need to get professional results, without coding or hiring an expert.

We recommend AIOSEO Pro, which comes with powerful features like an internal link assistant and redirection manager. It also handles more basic SEO tasks like optimizing titles, meta descriptions, and keywords.

Some of the other awesome SEO features and tools in AIOSEO:

  • Analysis and scoring of your on-page SEO, with clear tips to improve
  • Custom sitemap generation
  • Automated schema markup for FAQ, recipes, articles, plus 15 more
  • Optimization for local and in-person businesses
  • Page link analysis, robots.txt editor, and much more

This premium plugin also makes building tables of contents in WordPress easy. Keep reading and find out how!

Step 1. Install AIOSEO

The first step is to install All in One SEO on your WordPress site. To begin, select a plan at AIOSEO.com and get your license. The Basic version gives you access to the Table of Contents feature.

After you register and have a license key, click Download AIOSEO to save the plugin file to your computer.

Download AIOSEO

Now, you need to log in to WordPress and install that file. Open the WordPress dashboard and click the Plugins » Add New menu link. Then click the Upload Plugin button on that screen.

Upload a plugin to WordPress

From there, you’ll choose the file you just downloaded from AIOSEO and click Install Now.

Upload AIOSEO

Click Activate Plugin on the next screen, and your AIOSEO plugin is active and ready to use! The Setup Wizard will help you through the rest of the setup in just a few clicks.

If you have more questions about this process, check out All in One’s installation guide to AIOSEO Pro.

Step 2. Open a WordPress Post or Page

While you can create a ToC in a new post, the most efficient method is to finish your post first and add a table of contents to the completed draft.

You can also insert a ToC into a published post if you like. Updating a post with new content and links is a great way to keep site content fresh.

So, go ahead and open a WordPress page that you want to insert a table of contents into. Pick a post or article that has more than a few hundred words and has multiple section headings.

We’ll use the article you’re reading as an example.

WordPress Page Example

Step 3. Add the AIOSEO Table of Contents Block

The next step is to place your cursor in the WordPress editor screen at the point where you want your table of contents to be displayed. Click Add block, and you’ll see the block selection popup window.

WordPress Add Block

Then type “aioseo” in the search box. You’ll see several custom blocks that are included in AIOSEO, including AIOSEO Table of Contents.

AIOSEO WordPress Table of Contents Block

Click on the Table of Contents block and AIOSEO generates your ToC immediately. You’ll see all your section headings in the order they appear in the body of the post.

AIOSEO also automatically creates clickable links from the ToC items to the matching headings.

AIOSEO Auto Generated Table of Contents in WordPress

Step 4. Edit Auto-Created Table of Contents

If you’re satisfied with your table of contents’ structure and content, you can go ahead and click the Done button.

However, if you want to re-arrange your table of contents items or hide some of them, AIOSEO lets you do that quickly and easily.

To remove items from the ToC, simply click on the eye icon on the right. They’ll be greyed out in the table and won’t show in the table of contents displayed to users.

AIOSEO WordPress Table of Contents Hide Item

In order to arrange your ToC items in a different order, click the Reorder button. Then, you can drag and drop the items in whatever order you like.

When you’re happy with the content and order of your ToC, click Done. Your custom table of contents is now part of your page. Click Preview to see how it looks on your actual website:

WordPress Table of Contents AIOSEO

If you want, you can add a heading above your ToC, or style however you like. Go ahead and test the links now to make sure they go to the right parts of your post.

When you need to edit the ToC, just click inside the block in the editor. You’ll go back to the editing mode in the AIOSEO Table of Contents block.

After your table of contents is just right, you’re ready to publish!

Bonus: Make a WordPress Table of Contents Without a Plugin

If you don’t want to use a plugin to create a ToC for some reason, don’t worry. You can still make a table of contents without a plugin and provide the same benefits for readers.

To do that, first you’re going to create a list, and then insert links from your list items to your table of contents headings.

You don’t have to use a list format, though. You could make a ToC with links using regular paragraph formatting, but it’s not as common.

To start, make a list with the List block in the WordPress block editor. You can make a ToC using either an ordered (numbered) list or a non-ordered (bulleted) list.

WordPress Add List Block

Add all the headings from your post that you want in the ToC into your list.

If you like, you can indent list items by selecting them and clicking the Increase indent icon. AIOSEO does this automatically with its Table of Contents block, but you’ll have to do it manually.

WordPress Table of Contents Item Indent

Link List Items to Heading Anchor Text

At this point, you’ll insert links into the list items. These internal links will take users right to the section of the post that they’re interested in.

Let’s use our first heading as an example, back in the WordPress block editor. If you place your cursor in the heading and click, you can see the options menu for that block. Click the 3-dot menu on the right and then click Show more settings.

WordPress Block Settings

After that, you’ll see a new settings menu in the right sidebar. Click on the Block tab to see Advanced settings for this block.

WordPress Block Anchor Text

The next step is to copy the text in the HTML ANCHOR box. Make sure and copy all of it exactly or your link won’t work. If you like, you can edit the anchor text before you copy it.

Now, go back to the bulleted list you created in the last step. Place your cursor in the list item where you want your link and click the Link icon.

WordPress Table of Contents Anchor Link

You’ll see a box pop up where you can enter your link target. In this case, paste the HTML anchor text you copied from the heading block earlier, with a hashtag (#) in front of the text. The hashtag tells WordPress and web browsers that this is an internal link within the same page.

WordPress ToC Anchor Text Internal Link

Click the Return arrow to add the link and save it. As you can see, the block editor shows you that this is an internal link, along with the entire text of the anchor text.

Now you’ll have to repeat this process for every item on your list. Make sure you preview and test your links for errors before you publish.

Format and style the list as you like, and you’ve created a manual WordPress table of contents, without a plugin. Nice job!

Conclusion: How to Make a WordPress Table of Contents

Like everything, there are other ways to create tables of contents in WordPress. But, they all follow basically the same formula we described here.

Hope you learned something in our post on how to add a table of contents to your WordPress pages! If you like this article, you might also enjoy these SEO hacks to increase organic traffic.

Not using MonsterInsights yet? What are you waiting for?

And please don’t forget to follow us on Twitter, Facebook and YouTube for more helpful Google Analytics tips.

 

Want to Try MonsterInsights for Free?

Enter the URL of Your WordPress website to install MonsterInsights Lite.

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.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.