How to Create a Table of Content for WordPress Post and Page Automatically

Long-form articles are always a blessing for your site. They let you tell about an issue in detail and also maximize your chances to rank higher. But, readers don’t always like long-form articles when they need just a section from your post. This is why organizing content in the right structure and placing a table of content at the beginning is so important. There are some ways to create a table of content on WordPress sites easily. Today, we will explain one in this post.

Table of content offers a smoother experience for the readers to find what they look for in your post. Without a table of content, readers are more likely to be lost in a long-form article. For easier navigation, sites like Wikipedia have a table of content for each post. And you want to have this too. So, let’s know more about the table of content and especially how you can have one in your website’s post. 

We will show you a user friendly and automatic way to create and display a table of contents generated from your posts and  pages. 

What Is a Table of Content?

Table of content aka TOC is a section of a long form article that highlights the entire content structure in a list that links the different parts of the article. It gives you a birds’ eye view of what the article includes so that you can go to the part you actually need to know instead of reading the whole article. 

Why Do You Need a Table of Content?

If you have long form articles on your site you need a table of content for each of the posts or pages. There are potential benefits of having a table of content are. 

  1. SEO Improvement: Having a table of content can help you improve your content SEO. Some popular WordPress SEO plugins like Rank Math have table of content in their SEO checklist. If your post or page has a table of content you SEO score in Rank math will increase.
  2. User Experience: Table of content offers a smoother experience for the visitors. They do not need to explore everything on the page or post to get their desired information. Reading the exact section that includes the information is sufficient. Table of content lets readers do just that.
  3. Easier Navigation: With a table of content, readers can decide which section to go for something they are looking for. It makes it easy for them to navigate.

How to Add Table of Contents for WordPress Posts Automatically With a Plugin

We are using the Easy Table of Contents plugin today. It is easy to set up. You can customize it for posts and pages. And also, there are options to change and even delete items from a table of content individually.

So, let’s get started.

Step 1: Install and Activate Easy Table of Content Plugin

easy table of content

First of all, you have to install the Easy Table of Content on your website. You can install it manually or anyway you want. Just install and activate the plugin.

Step 2: Customize Table of Content Settings

Once the plugin is installed and activated, it adds tables of content support for posts by default. All posts will generate tables of contents automatically. But you can customize a lot of things in the settings.

easy table of content

You can include other post types for table of content support, enable auto insertion, and do many more in the settings.

Step 3: Decide Where to Place a Table of Content

table of content

You can place your table of content in four different places such as Before first heading which is the default option, After first heading, Top, and Bottom. Besides that, you can also change the header level and decide on the toggle view.

Step 4: Style the Appearance

Style the Appearance

If you scroll down on the settings page you will see the options to style the appearance. You can width, font size, font weight, and select theme for table of content.

easy table of content

Also, upon choosing Custom as the theme option, there are options to control the entire table of content look. Pick color for each element individually.

Table of Content Advanced Options

There are some advanced ways to customize your tables of content in posts and pages. Some of the advanced options that Easy table of Content plugin offers are below.

Alternative Headings

Sometimes you may want your table of content heading items to be different from the original ones. In that case, you have to customize the advanced options for each individual post. 

Alternative Headings -table of content

Specify alternative table of contents header string. Add the header to be replaced and the alternative header on a single line separated with a pipe |. Put each additional original and alternative header on its own line. Follow the example in the above.

Exclude Headings

If in any case you want some of your headers to be excluded from the table of content, just like alternative heading, you have to do it in the advanced settings of the individual post.

easy table of content

Specify headings you want to exclude from the table of contents. Separate multiple headings with a pipe |. Use an asterisk * as a wildcard to match other text. See the example in the image above.

Turn off Auto Insertion

If you want to set a table of content individually to each of your posts. You have to turn off auto insertion in the global settings.

Every post will have a table of content settings underneath them. You can check Insert Table of Content and that post alone will get the table of content.

Some Other Table of Content WordPress Plugins

Apart from the Easy Table of Content WordPress plugins, there are other plugins that you can also try. Some of the notable alternatives are given below.

Create Table of Content on Gutenberg Editor

With some WordPress Gutenberg plugins, you can create a table of content for posts and pages manually. You just need to take the table of content block and the table is created automatically. There are some free Gutenberg plugins like Qubely that can help you create tables of content easily.

Table of Content Gutenberg Block Plugins

You can have advanced styling options to have control over the entire design of your tables of content with these plugins. But Gutenberg plugins do not have an auto insertion option.

Fix User Experience Issue With a Back to Top Button

When you have inserted a table of content inside a post or page, your readers will click on the desired heading and go there. But what if they want to get back to the table again to explore more? 

You need to have a button to come back to the top when you have scrolled down. If your theme does not have this button by default, you can install the To Top plugin to fix this user experience issue.

Some people might think that the table of content reduces the time readers usually stay on a page. The purpose of your post is to give readers what they want; you can’t trick them into staying long on your site. In fact, after setting up table of content for long articles on this site, we have not seen such type of negative impact. This is a proven way to create table of contents for your posts and pages. Because I did this way, you can do the same if you follow this tutorial carefully.

For more of such useful tutorials, visit Virfice regularly.

Newsletter Updates

Enter your email address below to subscribe to our newsletter

Leave a Reply