The table of contents is a must-have element of WordPress posts. But why it is important? Check out these reasons –
- Improves user experience as the user can easily navigate to the section they are interested in.
- Improves website SEO as Google automatically adds links generated by Table of contents in the search results next to your website.
- Increases CTR and relevancy as the user directly lands on the desired part of the post right from the Google search results.
In this post, we will tell you how to add a table of contents in WordPress posts and pages without writing any custom code HTML or CSS.
What is Table of Contents?
A table of contents (aka TOC) can be defined as an outline of a post or page usually placed at the start of the page.
Examples of Table of Contents
Check out some examples of table of contents –
1. Table of Contents on InformativeFeeds
2. Table of Contents on Wikipedia
How to Add Table of Contents in WordPress Post and Pages?
One way to add TOC is via writing custom HTML, adding links manually and assigning an ID to each section which is a tough job, especially for beginners.
Therefore we’re going to use the Easy Table of Contents WordPress Plugin to add a table of contents in WordPress.
The process is divided into 2 easy steps – Installation and Configuration of the plugin.
1. Install and Activate the Easy Table of Contents WordPress Plugin
The first step is to install and activate the Easy Table of Contents WordPress Plugin from the WordPress repository.
For more details, see our step by step guide on how to install a WordPress plugin.
2. Configuring Easy Table of Contents Plugin
Upon activation, Go to Dashboard > Settings > Table of Contents where you can configure TOC settings.
Below is the list of all the settings you can configure in the easy table of contents plugin.
(a) Enable / Disable Support on Post Types
You can choose post types on which you want to display a table of contents by enabling this setting.
(b) Auto-insertion of Table of Contents on Post Types
If you want to insert a table of contents automatically on certain post types, then you should select post types from this setting.
This setting lets you choose the position of the table of contents in a WordPress post.
You can display the TOC on below positions –
- Before the first heading
- After the first heading
(d) Display When Minimum number of Headings
You can even set a minimum number of headings before which TOC won’t get displayed.
(e) Header Label Settings
This setting lets you –
- Show or hide the header label text.
- Change the header label text. The default text is Table of Contents.
(f) Toggle and Initial View Settings
You can allow or disallow the user to toggle TOC’s visibility.
It also lets you choose whether you want to show or hide Table of Contents initially.
(g) Other Settings
You can also choose –
- Type of Counter (Decimal, Numeric, Roman or none)
- Enable/Disable Smooth Scroll
- Appearance Settings
- Advanced Settings
How to Enable/Disable Table of Contents on a Particular WordPress Post or Page?
One of the best things about this plugin is that it lets you disable TOC on some posts if you want to and you can do this by following below steps –
1. Edit the post or page from where you want to enable or disable the table of contents.
2. Scroll down to the bottom of the editing area. You will see meta boxes with the heading Table of Contents.
You can enable or disable TOC on this post or page by checking or unchecking this option.
You can also configure some advanced options like exclude headings, use alternate text for a particular heading in TOC, etc from this section.
Add Your Table of Contents Today
As we mentioned earlier, the table of contents is one of the best things to improve user experience, especially for long-form content.
And the easy table of contents WordPress plugin helps you to achieve that.
If you use any other plugin on your website, do let us know.
Also, if you have any queries, you can ask them in the comments below.