In previous post I have mentioned the 3 advantages of having Table of Contents WordPress in Blog post. Counting them we get –
- It is helpful in creating navigation inside individual posts
- It makes easy to interlink contents
- Impact in SEO is the major
It would take around no time to generate contents table in each and every wordpress post. So, in order to get one in your wordpress blog too, follow this guide.
How to Create Table of Contents in WordPress Blog?
Thankfully, we have to best way to create it in WordPress Blog.
- Using the Plus WordPress Plugin
- Not using any plugin
Table of Contents Plus WordPress Plugin
This wordpress plugin do it everything without any hosch-posch. All you need to install and setup this plugin. Table of Contents Plus , forget the plus part it is totally free. Even though it has very little customization. Remember you can edit its CSS file too. Yet another thing I want to point is that. This will help you to create Wikipedia like contents table in your wordpress. So, if you’re using Wiki related theme, this gives the advantage.
Now, in this post I will help you to setup the basics of this wordpress plugin.
- Install table of contents plus from Plugins > Add New.
- Click on Settings > TOC +
Select Position – We have multiple positions to choose. I suggest you to go with either top or after first heading. Remember, if you’d chooses after first heading. Make sure to adjust heading levels from Advanced. As a suggestion uncheck H1 and H2. This would not count H2 headings inside post.
Show When – You have option to limit minimum number of headings. We better suggest 3 or 4.
Auto Insert … – Choose Post.
Heading text – Let it default.
Show hierarchy CHECK, Number list items CHECK, Enable smooth scroll effect CHECK.
This is my recommended settings.
This wp plugin does not only allow this function. But, also help you to generate easy to make sitemap for your page. But with pages and category only. For more details using it please check out the sitemap tab. In order to generate a sitemap page.
- Move to Sitemap tab.
- Create a new page in WordPress and paste the shortcode.
Table of Contents in WordPress without Plugin
I don’t understand whats wrong with using above plugin. ToC + is light weighted and does not impact your gtmetrix rating. Anyway, we serve your wish.
I am going to use the same tool which I used for Blogspot.
Download this tool from here.
- Create your blog post in WordPress editor.
- Once you done with it, click on Text tab.
- Copy down the entire code and past it in notepad. Paste the <!– INSERT contents –>where you want your index to be displayed.
- Save this file with .html extension.
- Load that page in the HTML table of contents generator tool.
- Click on output file and create a new file .html extension. This will be your output file.
- Click build.
- Right click on saved file and click edit. Copy down the content and paste it in your WordPress post editor.
Using the Anchor Tag
If you are ready to go old school, here follow this guide.
- Copy all the headings and start pasting where you want your table of contents to shown.
- Click on text tab to view source code.
- In <h3 tag add the line <h3 id = “id1” to indicate first content. Follow the same technique for third and forth and so on.
- Go to your index section. Select the piece of text which you want to anchor. Click on link icon and add #id1 to it. For a quick test click here.
Now when someone add that anchor link. The web browser get request to scroll down to the matching id. Since, it is very easy to generate and without wordpress plugin. It is not much effective and requires you to do manually for every second blog post.
So, these are three best ways imo to integrate Table of Contents in your post. If you have tried anything else and getting better result. Do dare to share with us.