Table of Contents Plus

A powerful yet user friendly plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories across your entire site.


Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn’t get lost through CSS differences across themes.

This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles. Discover how Google uses this index to provide ‘Jump To’ links to your content.

Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, other appearance, and more. For power users, expand the advanced options to further tweak its behaviour – eg: exclude undesired heading levels like h5 and h6 from being included; disable the output of the included CSS file; adjust the top offset and more. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.

Prefer to include the index in the sidebar? Go to Appearance > Widgets and drag the TOC+ to your desired sidebar and position.

Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.


Install / upgrade

Install the plugin by searching for Table of Contents Plus from the plugin add menu, or directly from the WordPress plugins repository.

There are no special upgrade instructions (woohoo!). Overwrite your existing folder with the latest or use the streamlined approach in the plugin menu. Your options will not be lost.


The simplest approach

For the impatient, all you have to do is enable the plugin.

The plugin will apply default settings and produce the table of contents before the first heading on pages (not posts, nor custom post types) with four or more headings.

No shortcodes are needed.

Where’s my table of contents?

  1. In most cases, the post, page or custom post type has less than the minimum number of headings. By default, this is set to four so make sure you have at least four headings within your content. If you want to change this value, you can find it under ‘Main Options’ > ‘Show when’.
  2. Is auto insertion enabled for your content type? By default, only pages are enabled.
  3. Have you got [ no_toc ] somewhere within the content? This will disable the index for the current post, page or custom post type.
  4. If you are using the TOC+ widget, check if you have the “Show the table of contents only in the sidebar” enabled as this will limit its display to only the sidebar. You can check by going into Appearance > Widgets.
  5. You may have restricted generation to a URL path match. The setting can be found in the advanced section under Main Options.

How do I stop the table of contents from appearing on a single page?

Place the following [ no_toc ] anywhere on the page to suppress the table of contents. This is known as a shortcode and works for posts, pages and custom post types that make use of the_content()

I’ve set wrapping to left or right but the headings don’t wrap around the table of contents

This normally occurs when there is a CSS clear directive in or around the heading originating from the theme (Twenty Eleven and Twenty Twelve are two themes which do this). This directive tells the user agent to reset the previous wrapping specifications.

You can adjust your theme’s CSS or try moving the table of contents position to the top of the page. If you didn’t build your theme, I’d highly suggest you try the Custom CSS plugin if you wish to make CSS changes.

Try adding the following CSS to allow the wrapping to occur around the table of contents:
h1, h2, h3, h4, h5, h6 { clear: none; }

How do I include the name of the page in the table of contents title?

As the title of the page changes depending on the page you’re viewing, you can use the following special variable to automatically insert the title of the page into the table of contents heading:


You can use it as is or place text either side of the variable.

As an example: if your page is named Great Expectations and your table of contents title is set to Contents for %PAGE_NAME%, the final title would read Contents for Great Expectations

My site has 100 pages but I only want the table of contents to appear on 10 of them

You could put [ no_toc ] on the 90 pages but that wouldn’t be fun… so try the following:

  1. Go to Settings > TOC+ and disable the auto insertion option for pages (or the content type you’re working with).
  2. Add [ toc ] onto the 10 pages that need them. Note that the table of contents will appear where you placed the shortcode.

Alternatively, you could also experiment with the restrict path option if the pages you want to include the index on all fall within a certain section of your site (eg /doc/).

I want to ignore certain headings

Use the ‘exclude headings’ option if you would like to ignore certain headings. Separate multiple headings with a pipe |. Use an asterisk * as a wildcard to match other text. Note that this is not case sensitive. Some examples include:

  • Fruit* ignore headings starting with Fruit
  • *Fruit Diet* ignore headings with Fruit Diet somewhere in the heading
  • Apple Tree|Oranges|Yellow Bananas ignore headings that are exactly Apple Tree, Oranges or Yellow Bananas

Can I have the table of contents in the sidebar?

Use the TOC+ widget and drag it into your desired position. If you want the table of contents to only be displayed in the sidebar, then make sure you tick that option in the widget.

Unlike Wikipedia, I want all my anchors to be lowercase and use hyphens rather than underscores

There are two options that allow you to adjust the casing and use of hyphens. If you still require more, you can massage it a little more by attaching into the toc_url_anchor_target filter. See the developers section for an example.

I would like to incorporate a sitemap

  1. Create a page for your sitemap (if you have an existing one, use that instead).
  2. Add [ sitemap ] into your page and save.

The above is the simplest example of integrating a sitemap listing all pages and categories. You can customise the sitemap options under Settings > TOC+ or check out some of the more advanced uses with the sitemap related shortcodes below.

You could also incorporate a sitemap using a text widget and pasting any of the sitemap shortcodes.

The sitemap uses a strange font dissimilar to the rest of the site

No extra styles are created for the sitemap, instead it inherits any styles you used when adding the shortcode. If you copy and pasted, you probably also copied the ‘code’ tags surrounding it so remove them if this is the case.

In most cases, try to have the shortcode on its own line with nothing before or after the square brackets.


The plugin was designed to be as seamless and painfree as possible and did not require you to insert a shortcode for operation. However, using the shortcode allows you to fully control the position of the table of contents within your page. The following shortcodes are available with this plugin.

When parameters are left out for the shortcodes below, they will fallback to the settings you defined under Settings > TOC+.

[ toc ]Lets you generate the table of contents at the preferred position. Also useful for sites that only require a TOC on a small handful of pages.
  • label: text, title of the table of contents
  • no_label: true/false, shows or hides the title
  • wrapping: text, either “left” or “right”
  • heading_levels: numbers, this lets you select the heading levels you want included in the table of contents. Separate multiple levels with a comma. Example: include headings 3, 4 and 5 but exclude the others with heading_levels="3,4,5"
  • exclude: text, enter headings to be excluded. Separate multiple headings with a pipe |. Use an asterisk * as a wildcard to match other text. You could also use regular expressions for more advanced matching.
  • class: text, enter CSS classes to be added to the container. Separate multiple classes with a space.
[ no_toc ]Allows you to disable the table of contents for the current post, page, or custom post type. 
[ sitemap ]Produces a listing of all pages and categories for your site. You can use this on any post, page or even in a text widget. 
[ sitemap_pages ]Lets you print out a listing of only pages.
  • heading: number between 1 and 6, defines which html heading to use
  • label: text, title of the list
  • no_label: true/false, shows or hides the list heading
  • exclude: IDs of the pages or categories you wish to exclude
  • exclude_tree: ID of the page or category you wish to exclude including its all descendants
[ sitemap_categories ]Similar to [ sitemap_pages ] but for categories. 
[ sitemap_posts ]This lets you print out an index of all published posts on your site. By default, posts are listed in alphabetical order grouped by their first letters. There are CSS classes for each section, letter and list allowing you to customise the appearance.
  • order: text, either ASC or DESC
  • orderby: text, popular options include “title”, “date”, “ID”, and “rand”. See WP_Query for a list.
  • separate: true/false (defaults to true), does not separate the lists by first letter when set to false.

For developers

How do I customise my anchors?

If you’re still not happy with the anchors, you can modify them to suit your needs through a custom function hooked into the toc_url_anchor_target filter. As an example, place the below code snippet into your functions.php file to convert all anchors to uppercase.

function my_custom_anchor( $anchor )
	return strtoupper( $anchor );
add_filter( 'toc_url_anchor_target', 'my_custom_anchor' );

toc_get_index( $content = ”, $prefix_url = ” )

Returns a HTML formatted string of the table of contents without the surrounding UL or OL tags to allow the theme editor to supply their own ID and/or classes to the outer list.

Both parameters are optional:

  • $content is the entire content with headings. If blank, will default to the current content found in $post (eg within “the loop”).
  • $prefix_url is the URL to prefix the anchor with. If a string was provided, it will be used as is. If set to “true” then will try to obtain the permalink from the $post object.

These examples assume you are within “the loop”:

  1. Obtain the index for the current page
    echo '<ul id="my_toc">' . toc_get_index() . '</ul>';
  2. Create a listing of all children and their headings
    $children = new WP_Query(array(
    	'post_parent' => get_the_ID(),
    	'posts_per_page' => -1	// get all children
    while ( $children->have_posts() ) {
    		'<h3>' . get_the_title() . '</h3>' .
    		'<ul>' . toc_get_index( get_the_content(), get_permalink( $children->post->ID ) ) . '</ul>'

Versioning scheme

I have adopted the same Ubuntu versioning scheme so the first release is 1107.

Other releases in the same month will be dot releases, eg the second release in July 2011 is 1107.1.

I love it, how can I show my appreciation?

If you have been impressed with this plugin and would like to somehow show some appreciation, rather than send a donation my way, please donate to your charity of choice. Feel free to leave a short note here if you’d like.

I will never ask for any form of reward or compensation. Helping others achieve their goals is satisfying enough 🙂

Questions or suggestions?

If you have questions or suggestions, please place them below.

1,136 thoughts on “Table of Contents Plus

  1. Pingback: Table of Contents Plus 1311 released | dublue

  2. Pete says:


    Great plugin. I have a question:

    I want to 1 table of contents that includes posts from many pages. I want to create a table of contents within the Global Content Block plugin and just enter the shortcode of the Global Content Block plugin in any future post I want. Am I making any sense?

    Is that possible?

    • Mike T says:

      I’m not sure but the Global Content Block plugin allows you to insert PHP so you could use any WordPress API function to do what you need it to do. So if you’re after a listing of posts, then try get_posts or WP_Query to get exactly what you want.

  3. Pingback: Die besten Wordpress Plugins 2013 - Nicht nur für SEO!

  4. The plugin files (css, js) are loaded on every page of my site whereas I’m using it only for a single post. How to solve this?

    Great work with the plugin by the way!

    • Mike T says:

      You can’t without amending the right now code.

      I’ll look into enqueueing the scripts into the is_eligible function which should mean the files are loaded only when needed.

  5. Pingback: Wordpressプラグイン2種導入 | Yoshihara.LaB

  6. Caitlin says:

    Hi there,

    I’ve implemented toc plus on my wp site, and used headers to get the toc. The table is generated correctly, but when I click on any of the links, it takes me back to my homepage?! Help!

    • Mike T says:

      Hi – I’ve had this happen before with a SEO plugin that was changing the loop and not resetting at the end. If you are running any SEO plugins, try disabling it temporarily to see if it works?

  7. Hi TOC+ Team !
    I hope you have a nice day today ^^
    I’ve just installed your great plug in but i have a little problem to exclude pages from my resume. Here my shortcode :
    [sitemap_pages no_label="false" exclude="sommaire-cours"] like you can see my ID for my page is “sommaire-cours” (not a number ??)
    And with this shortcode, my page appears in my resume, someone can help me to understand ?

    To your success,

    • Mike T says:

      Hi – the ID is meant to be the unique number for the page (rather than the title or the textual slug). You can get the ID by mousing over the page when viewing it in the list in wp-admin > pages. If you want to exclude many pages, separate them with a comma, eg: exclude=”10,11,12″

  8. Hi Mike – I don’t know if other people have run into this problem, but I’m getting an extra and then the first letters of the headline words… Any thoughts? Help appreciated! Great tool. C

  9. Pingback: 20 Must Have Wordpress Plugin For Serious Blogger | Pahan Blog

  10. amine says:


    i have problem with RTL language, isn’t support RTL languages?
    it is difficult to do it?

    thank you a lot

    • Mike T says:

      I’m not sure why it wouldn’t work as I’ve seen the plugin used on alot of Japanese websites.

      What’s the problem you’re seeing? A link would be handy if you have one.

  11. I am sorry for being really stupid, but this is my first time trying anything like this.

    I want a [sitemap_pages] which is working but I want to exclude some top level pages.. so i added [sitemap_pages exclude="shop"|"home"] and tried various ways of adding the exclusions.. with ” ” etc.

    what am i doing wrong?

    • Mike T says:

      Hi Sue – the exclude property for sitemap_pages takes in the id numbers of the pages you wish to exclude (not the titles of the pages). You can find the IDs by mousing over the pages in the backend and viewing the statusbar, it should have a number in there somewhere. With the IDs, the shortcode should look something like:

      [sitemap_pages exclude="10,20,100"]

      If there is a whole section you want to exclude, you may like to try exclude_tree instead, something like:

      [sitemap_pages exclude_tree="100"]

      When in doubt, check out the help tab in Settings > TOC+ for a list of shortcodes, their properties, purpose and format.

  12. Renee says:


    I’ve translated your plugin to Dutch, can you please send me your email address so I can mail you the files?

  13. Hi, Mike! Just tried your plug-in and it’s working great. I just made a few modifications. I would like the TOC to show children (perhaps in a dropdown list, not unlike what Table of Contents Creator used to do) so that it can be a true TOC. Can you advise? All my best, Susan

  14. gregos100 says:

    Hello Mike,

    I love your plugin but it would be very usefull if it could take into account breaks.
    Indeed, when you have a very long post, you make often a page break.
    Your plugin have is a toc limited to 1 page and not to all pages.
    Any idea of how to us it with page breaks ?



  15. Hello, I’m aki from Japan but living Vietnam.
    I use TOC+ in my website and I feel very nice! but I found some problems.
    Please see these pages. each page don’t have [toc] ot [notoc] but there are TOC on global option. I expect to see toc on both pages.
    I saw server log but I couldn’t find any error. The difference of these pages is it have shortcode to link other pages or not.
    Could you tell me the solution?

    • Mike T says:

      Hi Aki – I can’t see a TOC from the first link but there is a TOC on the second.

      For the first link, I had a quick look at the content for the page. Is it a special page that dynamically pulls related content from other places? Does the actual content for the page (when you hit Edit Page in the admin bar) actually have all of the content there?

      • Hi, Mike
        Thank you for comment.
        This page has all of the content there but there is one shortcode. you can see rounded-square link in the middle of the contents, below “関連項目” heading. (I’m sorry to let you read Japanese)
        this is displayed by shortcode I made. This is used like [show id=xxxx] . xxxx will be id of the article. this cord contains function, “$post = get_post($id);”, to get other contents.

        ……Oh, I justrealize what is the problem just now during answering your question!!
        I used “wp_reset_postdata()” in the shortcode but I should use “wp_reset_query()”. I fixed just now and then I can see TOC on both page.

        If you have more suggestion, I’m happy to hear it.
        Thank you so much!!

      • Mike T says:

        Good to know that you got it to work. No other suggestion. Provided everything is followed in the proper manner then this should “just work” 🙂

  16. Pingback: 9 Wordpress Plug-ins We Love

  17. Hello, I have a question. When I use the “exclude” option, not only does the heading disappear from the TOC, but also from the content proper of the page; what is more, the number of position in TOC remains the same, only one of them is EMPTY, like in this example:


    1. Item no. 1
    2. Item no. 2
    3. Item no. 3


    2. Item no. 2
    3. Item no. 3

    Any way to troubleshoot it? Thanks a lot!

    • Mike T says:

      No shortcode property to do that but if you can add CSS, you can hide them on a per page basis by looking at the identifying class in the body tag, something like: <body class="... page-id-100 ..."

      Then use CSS like:

      .page-id-100 .toc_number {
      display: none;

  18. Hi, I came across your toc plugin and I am impressed and can’t wait but install it immediately to my wordpress blog. The toc shows up fine right after activating the plugin, however, clicking on the link somehow does not scroll down to where it should be, it just does nothing.

    Weird thing is I tried to open my post on my iPhone iOS6, the links work!!! But on iPad, it doesn’t.

    This really annoys me, I am not sure where I have done wrong. Any advise?

    sample post:

    Thanks a lot.

    • Mike T says:

      The HTML standard only allows for ASCII characters to be used as anchors. I haven’t been able to find if the standard has been updated to allow non ASCII characters yet.

  19. Hello, you once helped me with my problem (as the TOC wouldn’t show no matter what and then you figured out that I have it in my sidebar… 🙂 ) so I was thinking of helping with translation. I’m from Czech Republic and I Love your plugin so if you want to add Czech translation, I’ll be pleased to hear what to change (if you have some special language file) and help you with that 🙂

    Of course only if you’re interested 🙂

    With Regards
    Jan Verner

    • Mike T says:

      Hi Jan – hehe yes that was a ‘bright’ moment for both of us, especially after having gone through many tests 🙂

      It would be wonderful and of benefit to others if a Czech translation was available. The translation file can be found at

      I’m not much of a translator but others have used Poedit to create their translations. If you persevere and complete a translation, please send the results to michael at this domain. Thanks for your contributions!

  20. Roman says:

    Hello Mike!

    Is there a way to include in table of contents the headings generated in single.php?

    I have a custom single.php that displays additional content if it is a post of a certain category.


    • Mike T says:

      Try the help material for developers at the bottom of the help tab. I spose you could also try
      echo do_shortcode('[toc]');
      but I haven’t tried that approach yet.

      Note, you still need to make use of the_content so it can insert the anchors within the content and I believe you will need to have auto insert for posts enabled.

  21. Nils says:

    Hi Mike, let me first say that I LOVE toc+. It is not to often that I stumble upon such a great WordPress plugin. And, as a few ppl before me also have said, I would love it even more with multi-page/nextpage support. 🙂 Any plans to support this setup any time soon? Thanks.

  22. Pingback: Table of Contents Plus为文章或页面增加导航 - 爱WordPress

  23. I’m using the “Insert PHP” plugin and have a page built within there. However, the headings within my PHP code is not being detected by TOC+. Does anyone have any ideas?

    • Sorry, let me also add that it works within my [insert_php] tags, but will not work if I attempt to develop the page within another file. For example, I use:

    • Mike T says:

      The plugin works on content that is presented to it via ‘the_content’. If Insert PHP isn’t using it, then this plugin won’t get access to that content.

  24. Phil says:

    Hi Mike,

    Thanks for the great plugin!

    Sorry to make this such a long post. Just trying to explain everything clearly.

    Have been using TOC+ for some time and all was well. But after adding several new plugins that include content via shortcodes:

    RPS Include Content
    EmbedIt Pro
    AcademicPress (for adding footnotes)

    TOC+ either stops working when it encounters such plugins, that use shortcodes. Or, in the case of AcademicPress, TOC+ not only stops displaying a TOC but somehow causes the footnotes created by AcademicPress to stop displaying also? This is using the latest version of all of the above mentioned plugins and WordPress 3.6.

    Please note that before posting here I took the time to read through all of your support threads over at as well as here on your site.

    Gathered from your comments on other posts those seem more to address TOC+ not displaying include content generated by shortcodes. However, when using TOC+ with the above mentioned plugins TOC+ stops displaying or working altogether. That would seem to indicate a more serious conflict? And, again, in the case of AcademicPress TOC+ actually stops that plugin from working too.

    Your comments on other posts indicate that a possible solution is to add code that makes sure it captures ALL of the text and content being included to generate the page, including content generated by shortcodes, and making sure the entire content of the page gets passed to TOC+. In at least one case you felt that the problem wasn’t with TOC+ but with the other plugin being coded incorrectly.

    Out of curiosity I tested the Simple TOC plugin. It does not cause AcademicPress to stop working. And, more important, it continues to work even when the RPS Include Content and/or EmbedIt Pro plugins are also in use. However, it too does not include any text or content on the page that was generated via include text plugins and shortcodes.

    Question: Do you feel it is possible to fix the above conflicts? More important, though, would you be able to create a fix so that TOC+ can include headings generated by other plugins like RPS Include Content, EmbedIt Pro, and AcademicPress?

    Last but not least, I don’t currently see where you have a donation button or whether or not that is your preference. However, if it would help facilitate bringing this functionality to TOC+ I would be willing to make a contribution to help cover the time you have to put into coding.

    Thanks again so much!

    • Mike T says:

      Hi Phil – thanks for your extensive comment 🙂

      Let’s get the easy one out of the way first. Check out the appreciation section I added. Essentially, I haven’t and won’t be accepting donations but if you feel strongly in the form of helping, then please direct it towards your preferred charity.

      Next, I tried each of the plugins you listed with the goal to replicate your experience.

      Embedit Pro worked without problems for me. I enabled it, went to HTML Snippets and added a new piece of HTML content with headings (h3 and h4) then included it within my page content with [embedit snippet=”test”] and it worked ok. Even the TOC picked out the headings within the included snippet. A note with Embedit Pro though, it produces the following PHP warnings (as reported by Debug Bar):

      Notice: Use of undefined constant cf - assumed 'cf' in /data/www/ on line 95

      Notice: Use of undefined constant snippet - assumed 'snippet' in /data/www/ on line 103

      Notice: Use of undefined constant snippet - assumed 'snippet' in /data/www/ on line 105

      Notice: Use of undefined constant url - assumed 'url' in /data/www/ on line 147

      I next tried RPS Include Content and inserted [rps-include post=156] to one of my test pages with many headings. The result had included the content with post id 156 at the position I had placed the shortcode. The full TOC had all headings as expected and in the order as they appear to the public. One tip I picked up: do not use the [toc] shortcode within your content – rather, rely on the auto generation. However, if you must use the shortcode, then only use it in the parent page (the one where you you put [rps-include everywhere) otherwise the TOC may appear in a strange position.

      Both Embedit Pro and RPS Include Content worked when enabled at the same time and with content being included to the same parent.

      I couldn’t test AcademicPress because my poor mind didn’t know how to work it. However, upon enabling, the following PHP notice appears on every admin page:

      Notice: Trying to get property of non-object in /data/www/ on line 822

      And the following within the AcademicPress Virtualbox:

      Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Acp_UI_Virtualbox::display() should not be called statically in /data/www/ on line 925

      Notice: Trying to get property of non-object in /data/www/ on line 73

      Simple TOC (and probably other TOC plugins) would be triggering at level 10 (default) so may not be capturing any included content, or may be firing before other functionality from plugins do their bit. TOC+ fires much later at level 100 to try and ensure it captures the majority of content, including those from other plugins. If you want to experiment with TOC+ getting it to run earlier, then edit line 137 of toc.php (version 1308) and change the 100 to something like 10.

      To note, I am using the latest everything and I have auto insert for posts and pages enabled in Settings > TOC+

  25. chris says:

    hey there, is there a way to manually choose which links go into the TOC. ive already broken down my long articles into separate articles so for these, it would be better if i could choose the links inside the TOC so i can properly order them

    • Mike T says:

      The only way I can think of is to make the headings you want to be included the same level heading (eg heading 2) and don’t use that for any of your other headings within your content. That way you can configure the plugin to only pull out heading 2s to build the TOC.

      • Mike T says:

        I forgot to mention. If you go down this path, you can disable the headings globally in the advanced options in Settings > TOC+. Alternatively, if you use the shortcode, there are options to specify which headings to include.

  26. Erik says:


    I love the TOC plus plugin. Very nice and to the point.

    Are you considering adding a highlight function, that highlights in the TOC where you are on the page? I have seen a version here: To me, it would be a great addition to your plugin (I would’ve tried it myself but my programming skills are non-existent :-)).



    • Mike T says:

      Did you mean highlighting the heading that the user clicked on? If so, add the following CSS to your stylesheet (change yellow to whatever colour you prefer):

      h1 span:target,
      h2 span:target,
      h3 span:target,
      h4 span:target,
      h5 span:target,
      h6 span:target {
      background: yellow;

      If you’re talking about highlighting entries within a pinned TOC as the page is scrolled down, then take a look at jQuery scrollspy. If using Bootstrap as your framework, check out

      If the latter is what you meant, then no it won’t be coming in as it is heavily theme dependent and probably not as easily reusable across other themes. That said, to a theme developer, it should be fairly straightforward to add our tweaks 🙂 As an example, we pinned a smaller version of the TOC as the page is scrolled at

  27. Pingback: Table of Contents Plus 1308 released | dublue

  28. misc314 says:

    Hello, may I know if this plugin is working for WordPress 3.6?
    I’ve just installed this script, activated it, and gone through the settings. Unfortunately, TOC doesn’t show up. I’ve read what the Help section suggested by to no avail.

    I tried:
    – autoinsertion page and posts, with >2 headers. My pages and posts meet that criteria.
    – disable autoinsertion, but manually put [toc] in my post/page
    – disable autoinsertion, use widget and check the box to always show in sidebar, put [toc] in my post/page

    TOC never shows up at all. In fact, [toc] remains visible in the published post, suggesting the plugin did not run at all.

    Help please?
    PS Thank you for the awesome plugin. This page demonstrated it perfectly.

    • Mike T says:

      Yeah it works with 3.6…

      Did you create your own theme? Is it using the_content? If it was a custom theme, then it sounds like its printing out the content from the DB rather than via the API functions.

  29. Pingback: Child Pages Shortcode と Table of Contents Plusの共存 | Compile

  30. I have been using a trick I found to include content from one post into another post. It works fine normally but it seems to screw up the TOC. The code is in a shortcode and is basically this:

    $ip = get_page($id); // $id is the post id
    echo apply_filters(‘the_content’, $ip->post_content);

    When used on a page with [toc] in it it seems to eliminate the normal TOC and create one for the included content at a different place in the output. What I want is for the TOC to cover both the including post and the included post’s contents as though it were present at the point of the include shortcode.

    Any idea why your plugin does this and is there a way to do what I want without messing up the TOC?

    Thanks for a nice plugin!

    • Mike T says:

      Sorry, I’ve been thinking about a reply to this for a week now…

      The short answer would be it’s tricky as the plugin operates using the_content filter and can only do what is presented to it. Running multiple queries and providing a combined output to the plugin I believe won’t result in the desired outcome.

      I would suggest for you to edit the query before the_content is fired. That should populate the query object with the data you want. Take a look at the pre_get_post filter with an example.

  31. Adam says:

    Can you confirm that TOC+ works for generating google rich “jump to” snippets? I have none. And even this website doesn’t have google “jump to” results.

    So, do you know if it works with google? Or should I try something else?

    Great plugin 🙂

  32. Hi I have a question, On one of my pages I have videos. I have the [toc] code on that page but I wanted to break my page into “pages” using the Tag. The table of contents picks up the titles of the videos perfectly BUT after the nextpage tag , It does not let me add another [toc] , because I think the plugin treats it as more then one short code on the same page. Is there anything I can add to fix this?

    page 1 , has 20 videos, and I put the [toc] and only the titles of 1-7 show like it should

    then the next page tag

    then [toc] again I put it for the videos that come after, but nothing shows… Can I make it so I can have more then one on a page ?

  33. Just started testing this plugin, seems to work well. I like to be very hands on when I’m developing, and I was really excited to see that toc_get_index() was available to call from a theme template. I think it needs some work, however. I want to display the TOC on a custom post type, and I’d like to just call it in my theme via toc_get_index(), so I disabled TOC+ for all of the post types, and called the function in my template where I want it. This doesn’t work, and looking briefly at the code, probably because $tic->is_eligible() returns false for this post type. So my other option is to enable TOC+ for this post type, the problem is that TOC+ automatically inserts, and my function call is redundant. Am I missing something? I think the API needs some way to say “Yes, I know you’re disabled, but I’m calling you here because I REALLY want a TOC at this location”.

    I can probably just use the automatically generated TOC, but my first experience trying to insert a TOC manually was confusing…

    • Mike T says:

      Thanks Jonon, that’s great feedback.

      The difficulty is that the_content still needs to be called to allow TOC+ to insert anchor links for headings within the content so the page needs to be ‘eligible’ otherwise you will output the index but they won’t link to any of the headings without those anchors. You are right though, it is confusing and needs to be improved – ideally it should know that the API is being used and then to skip some of those eligibility checks.

  34. HI, Not really sure why this should be your problem as oppose to the other plugin that does not play nice with it, but I will ask you. I love this plugin but it does not play nice with my Portfolio Slideshow Pro plugin. it breaks the Thumbnail scroll (carousel). please see website example. I currently have your plugin it turned off, but I would love to use it again.

  35. Please forget my last comment, I forgot to activate a checkmark.

    Another suggestion: How is it possible to get fullstops after the mai heading
    At the moment it is
    1 Intro
    2 main
    3 something

    I want it to be:
    1. Intro
    2. main
    3. something

  36. Petr Veprek says:

    I recently installed your TOC+ plugin and it does a nice job for me. When I get a chance I may be able to provide translation to Czech. Do you know of anyone who is already working on translation to Czech?
    PS: We can discuss this offline via email if you want.

    • Mike T says:

      Hi Petr – you’re the first to express an interest in providing a Czech translation so feel free to go ahead should you wish. You can send your files to me on michael at this domain. Thanks

  37. Maryann says:

    Is there a way to enable dropdowns for sublistings? I’d love to use this plugin if I could make the listing of pages (sitemap) more manageable with a dropdown for each level of page.

    • Mike T says:

      Yes you would be able to but you’ll need to provide your own javascript to do so. There are enough hooks to target the nested lists to be able to make them toggleable or whatever effect you want to apply. As there are many options, I haven’t added any don’t anticipate that anything like that will be provided. If you want to play, start with something like the following selector to target the nested lists on page sitemaps.

      ul.toc_sitemap_pages_list ul.children

  38. Hi,
    I love your plugin, but I have one question. I have used the plugin on one of my pages that is in French, but the heading text is in English (Contents). How can I get it to say Contents in French (Table des Matières) on the French pages and Contents on the English pages?. I’m using Polylang and CodeStyling Localization to translate all strings of WordPress and menus in French but can’t seem to find how and where to translate that specific heading text string.
    Can anybody help, please?
    PS : same question for Hide (cacher in French)

    • Mike T says:

      Hi – you can use [toc label="Table des Matières"] to get the title changed on French pages, however, the “show” and “hide” isn’t currently customisable via the shortcode. It soon will be though!

  39. stefan2sander says:

    Hey dude,

    need Toc+ for my page (first/front page)… it shows up on .org/blabla or .org/blubblub but not .org/

    How can i solve this?


    • Mike T says:

      There’s an advanced option to enable it for the homepage. Note that it works best if there is only one page or one article being displayed on the homepage.

  40. Efrem says:


    We just installed your plugin and love it so far! The one problem we’re having is that it’s only finding the “standard” WordPress Categories but not the custom categories or custom Post types our theme uses.

    We’re using the Delicieux Theme ( and it has some special Post-type templates called “Food” and “Portfolio”.

    We’d love for those to be listed in our site map so we have a complete list of all of our recipes. Any ideas on how to get this working?

Comments are closed.