How to add table of contents in WordPress

How to add table of contents in wordpressWhen the article you want to posts clocks at around 3000 words, it becomes a bit hard to read. And while studies show that people do prefer longer articles, they also show that longer articles have a high drop-off rate.

However, there is a simple trick to retain your long-form content and keep a low bounce rate – with a “table of contents”.

If you have ever visited a Wikipedia article, you know that longer articles sport a small table which will automatically point to a specific section. This is what a “table of contents” is.

And it helps not only with visitor retention but with SEO as well. It allows Google to add “jump-to” links, which can guide the visitor directly to the section of your article he actually wants to read.

You can add a table of contents to any WordPress post or page by hand, writing some HTML code. However, this process is tedious and takes lots of time, which can be better spent elsewhere.

This is where the Table of Contents Plus plugin comes to help.

What this plugin does is to simply generate a table of contents, using your h2, 3, 4, etc. tags. It can do this automatically for all posts or pages. If you don’t want it for all pages, there is a handy shortcode, which can work on individual pages or posts.

How to install and set up Table of Contents Plus

The Table of Contents Plus plugin is straightforward to install. Log in to the WordPress admin, go to Plugins, click on Add New and type in Table of Contents Plus. It will be the first result.

Don’t fret about the fact that the plugin hasn’t been updated in over two years – it still works flawlessly.

Once the plugin is installed and activated it, it’s time to customize it. Go to Setting and from there select TOC+ to enter the customization menu.

The first thing to select is where your table of contents will be displayed. By default, it will show up before the first heading, meaning it will be displayed right on top of the first header tag. This is also the most natural place for a table of contents, and where people will expect to find it.

However, you can change this setting to top or bottom.

Next, you need to specify how many heading tags must a post have, for the table of contents to appear. The default number is 4, but you can change it to a higher or a lower number, depending on your needs.

Another thing you need to specify is if the table of contents should appear automatically on posts and pages or not. Simply mark the necessary check boxes.

If you leave them all empty, you will have to manually insert a table of contents when you want to have one.

Last but not least, you can modify the way your table of contents will look. There are some predefined skins, but you can also build your custom one.

How to generate a table of contents for a WordPress post or page?

Once you have the Table of Contents Plus plugin up and running, it’s time to get to work.

Depending on the settings you have chosen, the plugin will automatically insert tables of content to pages or posts, or you can do that manually.

If you have opted for the manual setup, go to a page or a post and enter the short tag – .

If you have opted for the automated approach, but don’t want to see the table of contents for certain article, you can use the short tag.

Another option is to display the table of contents as a widget. To do that, go to Appearance and click on Widgets.

In there, just drag and drop the TOC+ widget to any widget area you want. Make sure to check the ‘Show the table of contents only in the sidebar‘ checkbox. Otherwise, the table of contents will be displayed both in the widget and in the article.



Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.