SimpleTOC – Table of Contents Block


In Gutenberg, add a block and search for “SimpleTOC” or just “TOC”. You need to save your post before you add the block. It works by parsing the post content and retrieving the heading blocks and creates a new dynamic block with a list of links to the headings.

Hide the headline “Table of Contents” and set a maximum display depth in the blocks’ sidebar configuration. Add the CSS class “simpletoc-hidden” to a heading block to remove that specific heading from the generated TOC.


  • No javascript or css added.
  • Designed for Gutenberg.
  • Compatible with AMP plugins.
  • Minimal and valid HTML output.
  • Inherits the style of your theme.
  • Support for column block layouts.
  • Control the maximum depth of the headings.
  • Choose between an ordered and unordered html list.
  • SEO friendly: Disable the h2 heading of the TOC block and add your own.
  • Comes with English, French, Spanish, German, and Brazilian Portuguese translations.
  • Works with non-latin texts. Tested with Japanese and Arabic.
  • Finds headlines in groups and reusable blocks. And in groups within reusable blocks.
  • Rank Math support.


This plugin is forked from by pdewouters and uses code from by shazahm1

Many thanks to Tom J Nowell and and Sally CJ who both helped me a lot with my questions over at


  • SimpleTOC block in Gutenberg editor.
  • SimpleTOC in the post.
  • Simple but powerful. Customize each TOC as you like.
  • Control the maximum depth of the headings.


This plugin provides 1 block.

  • SimpleTOC


SimpleTOC can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from and installed manually…

In Gutenberg, add a block and search for “SimpleTOC” or just “TOC”. Please save your content before you use the block.


Why did you do this?

Because I needed a simple plugin to do this job and decided to do it on his own. I believe that a Table of Contents does not need Javascript and additional css. Furthermore the plugin should work out-of-the-box without any configuration.

How do I change the TOC heading ‘Table of contents’ to some other words?

Hide the headline in the sidebar options of SimpleTOC and add your own heading.

How do I add SimpleTOC to all articles automatically?

I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there would be a plugin that adds blocks to every post then this would be the solution. I think this should be another separate plug-in to keep the code of SimpleTOC clean and … well, simple. Maybe someone knows of a plug-in that adds blocks automatically to all posts with some parameters and settings? What about site editing in WordPress? I think the core team is working on something like that. I will keep this post open. If I have gained more knowledge how to solve this I will add this feature.

How do I add a background color to SimpleTOC?

SimpleTOC is simple. It will never load JavaScript or CSS. But you can add custom CSS yourself to your theme:

.simpletoc {
    padding: 1em 2em;
    background: #bada55;

If you want to add a color including the headline, add a custom css class to the SimpleTOC block. Name it “toctoc” or something like that.

.toctoc {
    padding: 1em 1em;
    background: #bada55;

If you use that CSS it will add a colored background to the whole TOC including the heading.

How do I add smooth scrolling?

You can optionally add the css class “smooth-scroll” to each link the TOC. Then you can install plugin that uses these classes.


Dec 3, 2021
Awesome, super-fast and super-lightweight without any added fluff ... just how I want it. To make typography, spacing, etc adjustments, I put it in a GenerateBlocks container ... easy-peasy 😉
Dec 3, 2021
Easy use, no problem ! But, language pack doesn't work. Whatever, we can replace "table of contents" with CSS. It could be fine if we can link an anchor when creating an internal link in page, product, article, ...
Jul 16, 2021
Perfect. Lightweight. Only wish it had AMP-friendly collapse options using "toggleVisibility" or something along those lines.
Jul 6, 2021
The plugin is perfect. The most important thing is that it does not use javascript. Just configure a block as needed and use it as a reusable block. Very good plugin - thanks for the good work
Jun 17, 2021
Buen complemente ligero y cumple el cometido!
Jun 8, 2021
Adding the SimpleTOC block to my pages is super easy, it works without any fuss, and it hasn't had any performance impacts as far as I can tell. I did find one bug, but the developer was able to fix it and publish a new version within a day or two, and they were very polite about it.

Contributors & Developers

“SimpleTOC – Table of Contents Block” is open source software. The following people have contributed to this plugin.


“SimpleTOC – Table of Contents Block” has been translated into 9 locales. Thank you to the translators for their contributions.

Translate “SimpleTOC – Table of Contents Block” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Change log


  • Feature: Prevent php warnings when HTML of posts is not valid.


  • Feature: SimpleTOC can be found in Gutenberg by entering “Table of Contents”.


  • Feature: Add the css class “smooth-scroll” to the links. This enables smooth scrolling in themes like GeneratePress.


  • Feature: Support for headlines in reusable blocks.


  • Feature: Added option to toggle absolute urls.


  • Feature: Added option to replace ul tag with ol tag. This will add decimal numbers to each heading in the TOC.
  • Feature: Works in nested blockes. This means support for column block layouts.


  • Feature: Support for non-latin headlines. SimpleTOC now uses a character block list rather than an allow list.
  • Feature: Add the CSS class “simpletoc-hidden” to the heading block to remove it from the Table of Contents.


  • Feature: Experimental support for Arabic Text.


  • Feature: Added option to set maximum level of the headings.


  • Added Brazilian Portuguese translations to the translations. Thanks Ralden Souza!


  • Added support for Rank Math plugin.