How to Add a Table of Contents to WordPress Posts

If you write long tutorials and guides, a table of contents can help your readers more easily navigate, get a sense of the content that’s coming, and find what they are looking for.

Here are a couple of plugins I like for adding a table of contents to posts.

Powerkit – Table of Contents

My favorite, in terms of design,  is the Table of Contents module in the Powerkit plugin. This plugin is a collection of  “essentials components for every WordPress blog or magazine.” However, it’s modular so you can disable the others if you don’t want to use them.

I wish that they created an actual block for this feature, but instead you have to use a shortcode. It’s quite easy but not as user-friendly as a dedicated block would be. However, if for any reason you are still using the Classic and not the Block editor in WordPress, this plugin will also work for you.

The most simple usage is to add the shortcode as-is:

Code language: JSON / JSON with Comments (json)

But you have some customization options:

[powerkit_toc title="In This Guide" depth="2" min_count="4" min_characters="1000"]
Code language: JSON / JSON with Comments (json)

With the provided parameters you can customize:

  • The title above the list of links
  • The depth of headings
  • The minimum number of headings in the page content required before the table will be displayed
  • The minimum number of characters of post content required before the table will be displayed
  • You can also prevent certain headings from being included

The output looks like this:

Powerkit table of contents in the wild

Kadence Blocks – Table of Contents

Kadence have a free plugin, Kadence Blocks, that gives you a small collection of blocks. It’s mostly modular so you can deactivate ones you’re not interested in.

This one is a real block, not a shortcode, and it’s very easily customizable.  You can specify the heading depth and have full control over the fonts for the heading and list items, and whether it’s expandable or not. 

The feature to split it into columns is a unique one and could be handy for very long lists.

This one is recommended if you’re looking for more features, and control over the design/layout of the table.

Heroic Table of Contents

Heroic Table of Contents is another Gutenberg-specific plugin. It’s easy to use but has a couple of handy features.

While you can still control which heading levels should be included in the overall list, you can also easily remove any unwanted headings from the generated table, so you have complete control over what appears in the list:

Stylistically you don’t have the fine-grained control over all the fonts, colors etc as you do with Kadence, instead there are a few preset styles to choose from.

Additionally it has the standard toggle of allowing the user to open/close the table:

There are many plugin options available for adding a table of contents to your content. The ones I’ve mentioned here are the best I’ve come across (and I tested many of them). I hope you’ll find them helpful!

Weekly WordPress Tips To Your Inbox

  • This field is for validation purposes and should be left unchanged.

Leave a Reply

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