LuckyWP Table of Contents


Creates SEO-friendly table of contents for your posts, pages or custom post types. Great customizable appearance.


  • Automatical insertion a table of contents (configure post types and position).
  • SEO-friendly: table of contents code is ready to use by Google for snippets on result page.
  • Insert by shortcode, Gutenberg block or widget.
  • Button on toolbar of the classic editor.
  • Gutenberg block into „Common Blocks“.
  • Setting the minimum number of headings to display table of contents.
  • Setting the depth of headings for table of contents.
  • Skip headings by level or text.
  • Hierarchical or linear view.
  • Numeration items: decimal or roman numbers in order or nested.
  • Customizable appearance: width, float, title font size and weight, items font size, colors.
  • Color schemes (dark, light, white, transparent) and the ability to override colors.
  • Toggle Show/Hide (optionally)
  • Customizalbe labels.
  • Smooth scroll (optionally).
  • Setting offset top for smooth scroll.
  • Wrap table of contents with <!–noindex–> tag (optionally).
  • Pretty hash in URL (like
  • Available override global settings for a particular post.
  • Highly compatible with WordPress themes and plugins.

Auto Insert

For automatical insertion a table of contents in a posts, select option „Auto Insert Table of Contents“ in the plugin settings (tab „Auto Insert“).

Supported positions:

  • before first heading;
  • after first heading;
  • after first block (paragraph, list or heading);
  • top of post content;
  • bottom of post content.

You can also select post types to which the table of contents will be automatically added.

Pretty hash in URL

By default, hash generated as heading text (for example, #How_Do_This). You can change hash format in global settings, tab „Misc.“.

For non-English websites it is recommended to enable the Intl PHP extension.


Filters lwptoc_before, lwptoc_after

Use for add custom HTML before/after the table of contents.


add_filter('lwptoc_before', function ($before) {
    return '<p>Example text before TOC.</p>' . $before;

Filter lwptoc_shortcode_tag

Use this filter for change shortcode tag name [lwptoc].


add_filter('lwptoc_shortcode_tag', function ($tag) {
    return 'toc';


  • Inhaltsverzeichnis
  • Gutenberg Support
  • Classic Editor Support
  • Customize Window
  • Examples of Color Solutions
  • Widget Settings
  • General Settings
  • Appearance Settings
  • Auto Insert Settings
  • Processing Headings Settings
  • Miscellaneous Settings


Dieses Plugin unterstützt 1 Block.



Installing from the WordPress control panel

  1. Go to the page „Plugins > Add New“.
  2. Input the name „LuckyWP Table of Contents“ in the search field
  3. Find the „LuckyWP Table of Contents“ plugin in the search result and click on the „Install Now“ button, the installation process of plugin will begin.
  4. Click „Activate“ when the installation is complete.

Installing with the archive

  1. Go to the page „Plugins > Add New“ on the WordPress control panel
  2. Click on the „Upload Plugin“ button, the form to upload the archive will be opened.
  3. Select the archive with the plugin and click „Install Now“.
  4. Click on the „Activate Plugin“ button when the installation is complete.

Manual installation

  1. Upload the folder luckywp-table-of-contents to a directory with the plugin, usually it is /wp-content/plugins/.
  2. Go to the page „Plugins > Add New“ on the WordPress control panel
  3. Find „LuckyWP Table of Contents“ in the plugins list and click „Activate“.

After activation

Into classic editor will appear button „Table of Contents“ (available on edit post/page screen).

Into Gutenberg editor will appear block „Table of Contents“ (see „Common Blocks“).

The menu item „Table of Contents“ will appear in the menu „Settings“ of the WordPress control panel.

For non-English websites it is recommended to enable the Intl PHP extension.


Took Over My Entire Site Without Warning

I installed the plugin because it said it was seo friendly, I clicked on the button in the editor on a draft (unpublished page) and started to mess with it. then noticed the next morning that my entire site of published pages and posts had a table of contents, totally messing up the store pages and making a mess of things. I uninstalled it and wont be using it again. not cool...

Hopefully temporary problem

I really like this plugin and it has worked well until the last update which I did just a few minutes ago. It caused all my pages that contain the table of contents to not be displayed. The message is simply that this site is having technical problems. Posts do not show. Restored my backup to the last version and everything works fine. Please fix this as I like the plugin.
Lies alle 17 Rezensionen

Mitwirkende & Entwickler

„LuckyWP Table of Contents“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:


„LuckyWP Table of Contents“ wurde in 3 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.

Übersetze „LuckyWP Table of Contents“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.



  • Bug fix


  • Enhancements for search engines (Google and other).


  • Bug fix


  • Added widget „Table of Contents“.
  • Added support output table of contents via do_shortcode('[lwptoc]').
  • Enhancements for more compatible with themes.


  • Bug fix


  • Skip headings by level or text.


  • Bug fix


  • Enhancements for more compatible with themes.


  • Added float options: „Center“ and „Right without flow“.
  • Added setting „Hash Format“.
  • In anchors instead „name“ attribute used „id“.
  • Minor enhancements in CSS for more compatible with themes.


  • Tag <noindex> replaced to <!–noindex–>.


  • Added option „Wrap table of contents with <noindex> tag“.
  • Added hook filters lwptoc_before, lwptoc_after, lwptoc_shortcode_tag.
  • Fix: into Gutenberg editor in block „Classic editor“ don’t loaded CSS for shortcode.


  • Bug fix


  • Minor appearance changes
  • Bug fix


  • Bug fix


  • Bug fix