Table of contents (TOC) is a helpful feature that allows visitors to navigate through the different sections of your content easily. It provides a clear overview of the topics covered in your article and helps users find the information they are looking for quickly. In this blog post, we will guide you on how to insert a table of contents in your WordPress website.
Table of Contents
Why Use a Table of Contents on your website?
A table of contents offers several benefits for both website owners and visitors:
- Improved User Experience: With a table of contents, users can jump directly to the section they are interested in, without the need to scroll through the post, saving them time and effort. This is especially useful if the article is long.
- Increased Readability: A TOC provides a visual structure to your content, making it easier for readers to scan and understand.
- Enhanced SEO: Including a table of contents can improve your search engine rankings by providing search engines with a clear outline of your content.
How to insert Table of Contents in WordPress Website manually without plugin?
Can you insert Table of Contents in WordPress website manually? Well, you sure can, if you want to!
But is it worth the effort? I would say ‘No’. As you will need to do some HTML editing to manually insert table of contents, which will be time consuming. Yes, you need to know HTML a bit too. Better use plugins for this job.
Table of Contents is nothing but a bunch of headings within your article which you can click to go directly to that portion of the article. So basically it is a bunch of hyperlinks. When you click on them, it takes you to the target.
So, you first need to edit the target and place a unique ID on the HTML element where you should be taken to when the user clicks on the TOC title. Something like this:
<h2 id=”some-unique-id1”> heading name </h2>
And the HTML of each table of content title will look something like this
<a target="_blank" href="#some-unique-id1">heading name</a>
You will need to do this for every table of content link you want to insert in your articles, manually. This is an overkill in my opinion. But if you are interested to know more, click on this link to read a guide on this.
How to insert Table of Contents in WordPress Website with plugins?
You can easily insert table of contents in WordPress website using some WordPress plugins. In this post, we will see two ways to insert table of contents in WordPress website.
- Rank Match SEO Plugin (if you are using the plugin for SEO)
- Easy Table of Contents Plugin
There are other similar plugins if you want to explore.
Step-by-Step Guide: How to insert Table of Contents in WordPress website using Rank Math SEO Plugin
Rank Math SEO is a powerful WordPress plugin that offers various features to optimize your website for search engines. And it also allows you to include a “Table of Contents” in your WordPress website.
To include a table of contents using Rank Math SEO Plugin, follow the following steps:
Install and Activate Rank Math SEO Plugin:
- Login to WordPress and click on PLUGINS > ADD NEW PLUGIN.
- Search for “Rank Math SEO” and install it as you would install any other WordPress plugin.
Enable Table of Contents Module:
Table of Contents is enabled by default in Rank Math SEO plugin for ‘blocks’. So you need to be using the ‘blocks editor’ to use the Table of Contents module from Rank Math SEO. To check it’s settings, do the following:
- Once the plugin is activated, go to “Rank Math SEO” > “General Settings.”
- In the “General Settings”, find the “BLOCKS” module.
- Here you can see the settings for the Table of Contents – it is very simple within minimalist settings. You can set the title for the Table of Contents, choose the style and exclude some headings if you want to.
[Tip: Preferably only select top 2-3 headings only for Table of Contents. Eg. H1, H2, H3. But it is up to you.]
Insert Table of Contents in your article
- Click on POSTS > Add a New Post
Make sure you are using BLOCK EDITOR as the Table of Content from Rank Math SEO is a block. If you are on CLASSIC EDITOR, you can switch to BLOCK EDITOR. - Click on the + (add block), and search for “table of content” block and click on the “Table of Contents by Rank Math” block to insert.
- As you begin to write your article and include headings in your article such as H1, H2, H3 etc., the table of contents will start to appear automatically. You can dynamically view the updates as you insert more headings.
Exclude some headings from the Table of Contents view
Table of Contents should ideally only include the key headings only. Too may headings may be distracting.
- Click on the Table of Contents block you have added.
- The settings for the block will appear on the right sidebar. Look for EXCLUDE HEADINGS.
- Click on the headings you want to exclude from the table of contents view.
That’s all.
As cited, the table of contents from the Rank Math SEO plugins will work with the Block Editor only. If you often use the Classic editor, you can explore the alternative plugin below.
How to insert Table of Contents in WordPress website using Easy Table of Contents Plugin
‘Easy Table of Contents’ WordPress plugin will help you to automatically generate a table of contents for your posts, pages and custom post types. It works with with the Classic Editor, Gutenberg (Block Editor). It includes many easy to understand options to configure when and where to insert the table of contents.
Install and Activate Easy Table of Contents Plugins
- Login to WordPress and click on PLUGINS > ADD NEW PLUGIN.
- Search for “Easy Table of Contents” and install it as you would install any other WordPress plugin.
Configure the settings
- Once the plugin is activated, go to “Easy Table of Contents” > and explore the settings.
There are lots of options but quite easy to understand. You can try playing around with each.
The following are some basic settings you should apply. - Under GENERAL SETTINGS > ENABLE SUPPORT : Select the content type on which table of contents should be enabled.
Basically you might want table of contents on POSTS and PAGES. Others are up to you. - Under GENERAL SETTINGS > AUTO INSERT : Select the content type on which table of contents should be auto inserted.
Basically you might want table of contents to be auto inserted on POSTS and PAGES. Others are up to you. - Under GENERAL SETTINGS > POSITION : Set the position where you want to insert the table of contents.
- Likewise, there are various options for you to set the appearance and when and where to display the table of contents.
Once you are done with the settings, the table of contents will be displayed automatically depending on how you have set it up.
So, these are two ways you can insert a table of contents in your WordPress website. There are other similar plugins in the WordPress plugins directory if you want to keep looking.
# table of contents in WordPress website
# TOC WordPress Plugin
#Useful WordPress Plugins
Leave a Comment (FB)