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 | WordPress Tips

  2. Paul says:

    Hey there – you forgot to mention the tiny detail of wtf a “heading” is. If I’m trying to put a ToC for 1 page that has multiple sections (“headings”?), how the heck do I mark each section so that the ToC is generated?!

    • Mike T says:

      I’ve been meaning to create a video guide but haven’t yet gotten around to it.

      When adding/editing your content, if you’re in the html view, then check out this guide on headings. If you’re on the visual mode, then make sure you’re showing the kitchen sink which will give you two rows of buttons and then use the style drop down (should be the first on the second row) and select headings 1 through to 6 – similar to word processing.

    • Mike T says:

      I think it might be coming from your theme or elsewhere as the toc plugin doesnt add any of that. Youll need to hunt down the cause. My guess woukd be for you to use custom css to hide the background images.

      • Apparently, the little arrows only show up when I’m signed in. If I sign out, they go away.

        Thanks again for a wonderful plugin.

      • Mike T says:

        I’m back at home now so if you provide a link, I should be able to have a look at it and see what’s going on.

    • Sorry, never mind. I just realized that there’s an update to the Light Box plugin that seems to fix the conflict with TOC+. It wasn’t a problem with TOC+ at all.

  3. DJ says:

    Hi, I would like to find out how can I adjust this plugin to show the table of contents for only H1 and H2 level headings? It does continue to the level H3 (maybe even H4-H6), which I am using to name the tables.

    • Mike T says:

      I’m out of town atm so can’t say which lines they’re on but search for 1-6 which should be on the same line as preg_match and change the numbers to 1-2. You may need to reapply the changes with future updates.

      • DJ says:

        Thank you, it has helped me a lot.
        I would like to change one more thing – a font type and size of the contents text. As far as I have found out there is only an option to adjust the colour values through custom settings panel.

        In addition, I wish this great plugin would have an option to be used in the sidebar widget too. Another plugin called Web Fiction Table of Contents Sidebar Widget does it half-way – only for posts.

      • Mike T says:

        The font size is 95% of that set with your theme but you can use custom css to override and define your own specs. I’m still out of town so I can’t give you the exact selectors. Use the custom css plugin to try to experiment.

        Yep the widget is a neat idea and I have it on the todo list.

  4. REALLY IT IS A GREAT PLUGIN. This is really what I look for since 2 year. I’ve tried many plugins but all of them does not meet what I need. Thanks for this great job.

  5. I love the plugin. It’s neat, works well and encourages me to use headline tags where previously I used bold text.

    I have a request: can you make it so that the table of contents displays twice?

    Once within the post as it currently does and once ‘collapsed’ as a button at the bottom of the screen so readers have easy access to it. A back-to-top feature in the collapsed button would be great and maybe the button could be positionable by the site owner or drag-n-dropable by the frontend user.

    Anyway, thanks for the plugin. I love it!

  6. Hi!

    A great and useful pluggin is that “Content table” but I Think it will be more complete if we can return-back from the destination-link mainly when content is too rich and pages too long.
    Is this an idea for a new future?
    Demo: Table of contents
    1- You clic on link1
    2- You jump to the content of Link1
    3- There’s a return-back link or an icon at the end of the title of the content
    4- You clic on it and you return back to the Table of contents”

    • Mike T says:

      Yep it’s been on my todo list since day one but I’ve put it off as I think through delivery, eg: inline links, persistent back to top link at the bottom, or maybe a persistent toc to the left that appears as you mouse over it.

      I like the last two options but making it work (and look) as intended across many themes would be tricky.

      Imran has provided an inline back to top option here.

      A consideration with inline back to top links is that order may matter for non visual readers (eg screen readers). These readers may read “back to top” before all headings which seems weird as you’ve just gone to a new section of text and that’s how it was introduced. It may not be significant as Wikipedia places ‘edit’ links in a similar position.

      So yes, it is on my list.

  7. Pingback: ??? ??????? ????????? ??????? ?????? | Table of Contents Plus «

  8. Pingback: ??? ??????? ????????? ??????? ?????? | Table of Contents Plus «

  9. Ivan says:

    Hi, thanks for this great plugin.
    I was wondering would it be possible to add option in administration to switch off automatic registering style.css of this plugin, so I can manually add css to my main css file.
    It would be great because with almost every plugin comes css file and pages are getting bigger and slower.
    I know this way is easier to upgrade css style when plugin is updated, but I think there will not be any major changes in css šŸ˜‰

    • Mike T says:

      That’s a neat suggestion but it’ll only save one TCP request of 1.1k in size for this plugin. Don’t forget that these files (CSS, JS, images, attachments, etc) are cached by the browser next time they’re used so it won’t be pulled from your server. Additionally, the CSS could have been served with gzip compression reducing its size considerably.

      There are methods to improve the efficiency of your site as a whole (W3 Total Cache, WP Super Cache, WP Minify, CDNs, etc) that you may want to look into. They will provide a much bigger improvement than saving 1 TCP hit on first load.

      Don’t get me wrong, as a web developer at heart, I know exactly where you’re coming from. And your suggestion sounds like a nice power option that might make its way in šŸ™‚ Just giving you the full story if you haven’t yet considered them. I could look into minifying the CSS/JS files but again it wouldn’t be saving much.

      • Ivan says:

        Wow Mike that was very rich answer :). I was thinking about using caching plugins an I will took it up.
        The reason I contacted you is that this was the latest plugin I installed so it was convinient ;).
        Thanks for answer it was very informative šŸ˜‰

  10. Pingback: Table of Contents Plus 1109 released | dublue

  11. hi, nice plugin..good work!

    i use wp 3.2.1 and twenty eleven theme. but i don’t have toggle (show and hide) button. Anyway, thanks for this plugin.

    • Mike T says:

      I just checked your site and there is a 404 on the jquery.cookie.min.js file. Shonie and Rob have had this issue too and is caused by a false positive with mod_security blocking requests to files with “.cookie” in the name.

      The file has been renamed and a better fallback has been put in place such that it doesn’t break queued up javascript (for better compatibility). It should be out in the coming days. If you’re finding that it breaks other javascript code, disable “Enable visibility option” until the next version.

      More information can be found at the mod_security bug ticket.

      • daus says:

        Ahh..thanks. Right now i adjust the width in style.css #toc_container {width:auto !important;} so thats look neat with long headings.

        Can i just select in TOC options rather than style it in theme? or ignore it (only a suggestion) šŸ˜‰

      • Mike T says:

        Does putting it to 100% make it look the same as if it was set to auto? I just tried and I think they’re the same cause the default width for divs are 100%. Were you thinking something else?

  12. Good morning,

    Thank you for your plugin. I use WP 3.2.1 on Ubuntu 10.4 and Mozilla Firefox 3.6.20.

    I’m relatively new with WordPress. In a single page, I generated the [sitemap] with the following font parameters and it showed as expected on my OS/Browser :


    Link :
    Screenshot :

    However, on other platforms (iOs, Windows, Apple), the selected font is overwritten with Courier, so it doesn’t look good with the rest of the website.

    I’d appreciate if you gave me a tip of where and how to specify the font in the [sitemap] output.

    Thank you for your help.

    • Mike T says:

      Hi Antoine – it looks like you’ve copied the code tags surrounding [sitemap]. Try switching to HTML mode while editing your page and removing all code tags surrounding it.

      There aren’t any custom styles with the sitemap. It uses the styles defined with your theme.

  13. I think my email copied incorrectly. It should be [mod email removed: got it thx]. So sorry.

    This plug in seems to be just the thing I need. I basically just want a “table of contents/links” for our catalog as some of our customers seem to have problems with the menu at the top. The sitemap option seemed to be just the ticket and it shows up just fine. I used this code to exclude the other pages on the site: [sitemap exclude="69,729,110,498,692,410,655,507"]

    However all of the site pages are still showing. Is there a way to get those other pages to exclude that I have missed, or have I done the code incorrectly?

    Thank you for any insight you can give me.

    • Mike T says:

      Hi Shonie – Currently, you can exclude certain pages by using the [sitemap_pages] shortcode. So for the above example and assuming they were all page ids, you’d use:

      [sitemap_pages exclude="69,729,110,498,692,410,655,507"]

      Similarly, you can exclude categories but you need to use [sitemap_categories].

      Does this make sense?

      • It does make sense, and I had tried that, well I thought I had. It definitely displays well that way, but it is a moot point at this time. For some reason, TOC+ breaks my gallery and my sharing plug in. šŸ™

        At first I thought it was the product review plugin I had, but it’s definitely this one. Too bad because at first look it was exactly what I needed.

  14. This plug in seems to be just the thing I need. I basically just want a “table of contents/links” for our catalog as some of our customers seem to have problems with the menu at the top. The sitemap option seemed to be just the ticket and it shows up just fine. I used this code to exclude the other pages on the site: [sitemap exclude="69,729,110,498,692,410,655,507"]

    However all of the site pages are still showing. Is there a way to get those other pages to exclude that I have missed, or have I done the code incorrectly?

    Thank you for any insight you can give me.

  15. Hi Mike, it seems the last update has caused the Genesis Slider plugin to not function correctly. After I installed the TOC update, the Genesis Slider didn’t work correctly on my website. I disable the TOC plugin and the Genesis Slider works again.

  16. Pingback: Table of Contents Plus 1108.2 released | dublue

  17. chrismccoy says:

    great plugin works great except if i have the same headings twice, for example on the main page, if i have one post on top of another, the top smooth scroll will goto the correct, but if i go down post it treats the above post like the 2nd.

      • chrismccoy says:

        not what I meant really, its due to the smooth scrolling issue, i want them to appear on the main page.

        just if theirs 2 posts on the site with identical headings the top post treats as the 2nd post.

      • Mike T says:

        Does it work when smooth scrolling is disabled? If they are identical headings (including position of appearance), they would have exactly the same anchor. This obviously is not ideal and is in fact invalid HTML which is why its use on a homepage that lists a number posts should be avoided.

        However, I do have an existing ticket in place to look further into heading duplication avoidance and can add your experience/config to it. If you want to provide a link to help with it, please let me know (email michael at this domain).

    • Mike T says:

      So you mean pretty much any h2 headings that appear in the content will be excluded? For this example, what about h1 headings?

      Like a minimum heading level option say must be at least h3 or onwards?

  18. Hi Mike,
    Thanks for the great plugin. But I had an issue with it.
    Whenever I click on “continue reading” links in a search results page, I am just going to the top of the page. I deactivated the plugin and everything works fine. What seems to be the problem ? Thanks.

    • Mike T says:

      Try turning off smooth scroll in the options as it is hooking into anchor links for the current page (eg hyperlinks that start with #). I know some developers like to use ‘#’ as the destination to trigger other ajax stuff.

      Do you have a link that I can look at to see it in action? The more of these I can see, the better it is I can accommodate for them.

      • Hi Mike,
        Thanks for the quick reply. Yes, you were right, the problem was with using ‘#’ as the destination. Everything worked fine after I disabled the smooth scrolling.
        I did not provide you the link earlier because mine is a private blog – only for students preparing for competitive examinations in India. If you give me your email ID, I will send a username and password to you to look into it. I feel bad to miss the smooth scroll effect, it was a nice addition.
        Thanks again for your support Mike.

      • Hi Mike,
        I have seen your email ID in one of the above comments. I have mailed you a link for my website along with a username and password. Please have a look.

      • Mike T says:

        I like the smooth scroll feature too and have a few ideas to try. Quite positive I’ll be able to get it less needy/imposing.

        Got your email so will be in touch when I get a chance.

  19. It’s cool to be able to put [sitemap] in a sidebar widget, but what I’m really after is the ability to put [toc] in a sidebar widget.

    I tried it, but nothing renders.

    Can you add this functionality? It should be simple enough — just make the shortcode output a global variable.

  20. Don’t worry about overcrowding -> overloading us with updates LOL. We all update as soon as we see the message. Some plug-in developers send out updates almost every week and their stuff just keeps on getting better and better. I personally try to update my websites ( & and language studying programs every couple of days or by the end of the week, when possible. Your TOC rocks and I would update every day if I knew it was getting better šŸ˜‰


  21. Judia says:


    I’ve just downloaded your plugin, but i can’t make it display my posts. I’ve been using the shortcode [toc], but it’s not working. can you help me?

    • Mike T says:

      Hi Judia – sure but I’ll need more detail to be able to help. Have you had a look at the “Where’s my table of contents?” section under the Help tab in Settings > TOC+ ?

  22. Mike says:

    I just have to say this is the best TOC plugin I have tried so far. One thing though that constantly makes me look for other TOC plugins (haven’t found anyone better yet though =P)
    The problem is that if I have many headers in the post the TOC becomes very long and takes a lot of place. I would like to see a “hide/show” option in a near update so you can choose to hide or show the TOC. Just like in a wikipedia TOC. I’m sure you know what I mean.
    Anyway, thanks for a lovely plugin.


    • Mike T says:

      I actually have this ready for the next release šŸ™‚

      I think its functionality will be enabled by default but if you don’t like it, it can be turned off.

  23. Hi there!
    Your plugin is very good and does its job very well! Although there is one thing I noticed about the plugin that is missing. The problem is the TOC appears on the front-page / home-page and I am using excerpts, so it makes it all messy and I would love to have the ability to turn on/off whether or not the TOC shows up on the front-page / home-page.
    I read the thing about using the [no_toc] tag on pages, but if this is possible to use on the front-page / home-page I don’t know how to use it…
    Note: I don’t use a static front-page.
    Thank you for a great plugin and keep up the good work!! šŸ™‚

      • Hey Mike, good to see you keeping up with comments. I’m also experiencing an issue with the [no_toc] tag. Its not disabling the toc on my page, within a custom theme div. I’ve tried placing the tag in paragraphs, divs, and at the beginning and end of the page with no avail.

        I ended up using the exclusion rule, but my want those headers included in other TOCs on different pages… let me know if there’s a workaround for this.

    • savage says:

      Hey, great plugin!

      I am also experiencing the problem where the excerpts posts contain the table of contents t4ext generated by this plugin. I would like to disable the TOC showing up in the excerpt.

      Any ideas?

      • savage says:

        Ok, I fixed it by editing the table-of-contents-plus/toc.php

        I edited the conditions for displaying the TOC:
        if (
        ( in_array(get_post_type($post), $this->options['auto_insert_post_types']) && $this->show_toc && !is_search() && !is_archive()) ||
        ( $custom_toc_position !== false ))

        By adding the !is_home() condition:

        if (
        ( in_array(get_post_type($post), $this->options['auto_insert_post_types']) && $this->show_toc && !is_search() && !is_archive() && !is_home()) ||
        ( $custom_toc_position !== false ))

        I guess there are situations where the TOC should be displayed on the frontpage, but it would be nice to have an option to control this behaviour.

        Hope this helps!

      • Mike T says:

        Thx. There is a new advanced option to enable it for the homepage in the next release. The default will be off.

  24. Wafflecone says:

    Hmmmm, now I seem to having trouble with H2 tags doing it as well. Also, sometimes H2 links in the TOC won’t scroll to the bookmark location either. They either do nothing or scroll up.

    I sent you a link earlier. Let me know if you need it resent.

    Thanks Mike!

  25. Wafflecone says:

    Hi Mike,

    Thanks for making the plugin. I’ve got a weird situation. I’m using some H3 tags on my articles but when I click on the links generated by the plugin, the screen just scrolls to the top.

    My H2 tags work fine. Any ideas what I can try?


    • Mike T says:

      No problems. If you run into any issues, particularly now that it’s using the heading text to create the anchor, please let me know. Not sure how that will work in other languages.

  26. Pingback: Table of Contents Plus 1108 released | dublue

    • Mike T says:

      I’m not sure what issue you’re trying to describe as it seems to work. I can’t read Japanese but the headings looked ok to me.

    • Mike T says:

      Not currently. I can’t think of a situation where this may be used a lot. Are you able to provide one (for a possible future feature)?

      • Rob says:

        I have some pages where I place h1 and h2 tags above the TOC so when the h2 tag is clicked in the TOC, it scrolls up. It’s not a big deal though. I’ll just restructure my pages to have a proper structure..Wikipedia style.

    • Mike T says:

      Hi Rob. No probs, glad you found some use for it.

      When it takes you to just underneath the heading, are you logged in? Is the admin bar appearing over the top? If so, try enabling the smooth scroll effect which takes the admin bar into consideration. Is it happening without any persistent bars across the top?

      Funny you should mention the heading text as the anchor as I have been debating with myself about this. I would prefer seeing it too but will need to find a way to avoid repetitions (eg you have multiple headings with the same title). I can reuse the heading number but then it would be void when the heading moves elsewhere at a later point. I think that would be acceptable as the user will still be able to figure it out with the TOC index at the top anyway. Btw, this was one of things I was considering for the 1 Aug release so keep an eye out.

      • Rob says:

        I was logged in..great call.

        And I didn’t think about heading repetitions being a problem but I thought about it and now I see what you mean. I’ll definitely keep an eye out for this one. Thanks brother.

  27. Mike T says:

    @Aubrey and @Andrew

    I’ve updated trunk with the latest changes which should fix saving on a multisite install using sub folders. You can now hide the title. There are a few other changes so check the changelog.

    I haven’t tagged the release yet but plan to come 1st of Aug as I have a couple other things penned in. If you want to try beforehand, download the ‘Development Version’ from

  28. Andrew says:

    This is exactly what I needed: thanks very much! It seems really solid: the only minor thing I noticed is on the settings page, which has the word “heirarchy” (instead of hierarchy). If I might make one suggestion, it would also be nice to have a way to disable the numbers generated before the heading names, and to remove the “Contents” heading completely (it leaves a blank space if I delete the text).

    • Mike T says:

      Thx for the pick up.

      Re the numbers before the heading: I believe this is coming from the CSS for your theme. I aim to make it a little more consistent in the future though (eg override some of the theme specs like bulleted backgrounds, bullet types, numbering type, and spacing).

      Good suggestion re title. I’ll add an option to remove it completely.

  29. Great plugin. But, on my multiple-site setup your plugin will not allow me to save separate setting for each blog. Your form action points to a direct path in toc.php:


    If you change this to:


    it will allow multi-site users to use your plugin.


    • That comment didn’t post well. But the line in question is in toc.php like 314. You don’t need the PHP_SELF, you can just start it off with ?page=

    • Mike T says:

      Cool thanks – I’ll check it out.

      I’m surprised as I did my testing on a number of multisite installs but didn’t encounter any saving issues. My multisite installs started out as WPMU sites but I don’t think that should have any impact.

      Where did you install the plugin (mu-plugins or wp-plugins)? Did you activate site wide? I would like be able to replicate this and will try on a clean multisite setup.

  30. try to make plugin toc to work,
    did install
    did activate
    did try other template
    did make page ‘Sitemap’ and added [sitemap] in text on that page
    did write [toc] in header of post and in text body
    did tic ,post. option in options
    but no toc nowhere to be seen
    Thema Evanescence met 7 widgets WordPress 3.2.1.

    • Mike T says:

      Hi jJaap

      Do you have at least 4 headings on the post or page you want the TOC to appear?

      Are there any warnings or errors printed to the screen?

      Are you able to provide a link to where you’re trying to use this?

      • The posts do have headings (I guess) and I had the impression these headings of posts would make the content of the toc.
        That does not work, so I will look for an other solution. maybe another plugin?
        thank for answers.

    • Hi Jjaap,

      It’s better to use Table of content plugin like this if you have long content pages (about >800 words) with many heading/sup-heading (at least 4 as Mike suggested). In this case it will help the readers found the information easily and like your articles. Otherwise, in case you have a short content with no or <4 heading, it's not necessary to use the such plugin in my opinion. In any case, the more plugin, the more slow of loading.

  31. Hi,

    Can I use this to create multiple tables of contents? I am trying to create a journal quarterly publication and each issue would have it’s own table of contents. It will likely be built through a custom post type, so the regular posts/pages should be excluded.


    • Mike T says:

      Hi Dana

      Multiple table of contents on the same page/issue – nope. If you create separate issues, then yes a table of contents could appear for each.

  32. Jas says:

    Hi. Is there an easy way to designate the padding between the bullet and bullet text? I haven’t seen anything in the css directly that can affect this. Not sure if its an issue with the theme itself.


    • Mike T says:

      Hi Jas

      The plugin inherits all of that spacing/presentation related stuff from the theme you are using.

      For now at least, you’ll need to use CSS to override the theme margins, paddings, list styles etc which can be difficult if not already familiar with CSS and html. If you provide a link, I may be able to help with the CSS. Email me at michael at this domain.

      I’m thinking of attempting to make some of that presentation stuff more consistent for a new release but don’t think it will be out for another couple of weeks.

  33. Hi,

    Maybe something to think about as a future feature. With longer articles it is quite common to use pagination (e.g. online newspaper articles). In that case the TOC would on the first page of the article also show the headings of the other pages and jump there.

    • Congratulations for your powerful plugin. Do you plan the pagination feature? I’m very interested in that functionality. Greetings from Germany and CU Boeffi

      • Mike T says:

        Yeah I got it working for flat lists but need to also get it working when hierarchy has been selected.

      • Jason says:

        Hi Micheal, that feature would be perfect some uses case I have in mind as well. I’ve been looking everywhere for something like that but it doesn’t seem to exist as a feature in a plugin at this stage yet as far as I can tell…

        Do you have a rough idea when you think it might be ready?

      • Mike T says:

        @Jason, that’s a good question and I wish I could commit to a release date. I know an update has been long overdue.

    • Hi,
      The same, I have created pagination (use”pages” to tell about item of pagination leads to not understandable texts…) for long posts. The items of pagination fits with a concept of “part” associated to a level of heading.
      For now the lonely solution is to create manually a TOC for first page and it is impossible (possible but so hard) to get a full detailed TOC of the full post…

      So in my opinion TOC have no compatibility with posts pagination

      • Self,

        With the Widget it is not the same. The lateral Table content is quite perfect :
        1- contents the whole table even pagination
        2- default css ok while the TOC in line have not a good indentation et height of paragraphs

        With lateral widget can be published without changes

      • Self,

        Even though the lateral widgets display the whole table when pagination of post is used the links are wrong.

        Table of contents don’t manages the “page” :
        if you are currently on page 3 into the “post” p5 the request to go into an element of the table which is into page 6 will have an url and request

        ?p=5&page=3# which fails it should be
        ?p=5&page=6# which succeeds (manually changed).

        Table content plus remains unusable with post paginated

        note : an internal table (array) should give the “page” of any element, I quickly look at the code for this…

  34. Pingback: Table of Contents Plus 1107.1 released | dublue

    • Mike T says:

      Hi Imran

      Thanks for linking to your amendments. I’ll take a look next time I’m on a desktop as the mobile version of the link keeps redirecting me elsewhere.

      I actually had planned to incorporate back to top links but didn’t for this first release as wikipedia didn’t either.

    • Gabrielle says:

      Hey Imran,

      Your “back to top” functionality is a great addition, but I’m having some issues with IE (of course). You can see this issue if you open up your sample page in IE:
      (I’m using IE8)

      The title and ul are getting split into different divs and both getting the #toc_container attributes (floats, borders, ect.) added to them, creating two boxes and a fubar-ed layout (if you are text-wrapping, floating).

      I tried just disable the TOC, then re-add it with a shortcode, which I would then wrap in a div that I could style, but your amended php file does not have the [toc] shortcode, and I’m having trouble adding it in successfully.

      I’m wondering if either of you fine developers could think of a solution for this issue? I’d love to be able to use this plugin, but unless it’s resolved, I’ll be on the hunt for a new one šŸ™


    • Gabrielle says:

      Hey Imran,

      Your “back to top” functionality is a great addition, but I’m having some issues with IE (of course). You can see this issue if you open up your sample page in IE:

      The title and ul are getting split into different divs and both getting the #toc_container attributes (floats, borders, ect.) added to them, creating two boxes and a fubar-ed layout (if you are text-wrapping, floating).

      I tried just disable the TOC, then re-add it with a shortcode, which I would wrap in a div that I could style, but your amended php file does not have the [toc] shortcode, and I’m having trouble adding it in successfully.

      I’m wondering if either of you fine developers could think of a solution for this issue? I’d love to be able to use this plugin, but unless it’s resolved, I’ll be on the hunt for a new one šŸ™


      • Mike T says:

        @Gabrielle, an alternative approach would be to use a separate back to top plugin. I haven’t tried any but the dynamic to top plugin looks alright. If this works for you, then you’ll also be able to use the latest toc+ version.

  35. Pingback: wp: back to toc | Imran's Blog

  36. Stacey says:

    I have been looking for an easy to use TOC. I came across yours. Unfortuneatly, I cannot get it to work. I am uncertain as to why this is. I made a test post and the TOC appeared once. When the page was refreshed, it disappeared and I do not know how to get it back. It has never appeared on any page made previous to the installation of this plugin.

    Any suggestions?


    • Mike T says:

      Hi Stacey

      Do you have more than 4 headings on the post/page? It doesn’t count heading 1 as that should be your content title or site title.
      By default, it does pages so if you want it to appear on posts, you need to enable it in Settings > TOC+Ā 

      Do you get any errors? If you’re still having issues, can you provide a link?

  37. We are building a series of learning modules for our WP website, where each module will be a singe WP page. There will be lots of content, and your wikipedia approach is exactly what we’re looking for. I’m wondering, though, and being the content director and not the techie directer, is your plugin something that we can easily turn on/off from our pages. In other words, every page on our website EXCEPT the module pages will not have tables of content, and I need to make sure that if we go with yours, we have the option of turning it on/off. If you get the chance to reply, I’d really appreciate it.

    • Mike T says:

      Hi Regan

      At present, you can tell it to auto insert the table of contents on all pages but on pages where you don’t want them to appear, you can place the [no_toc] shortcode anywhere within the page’s content to disable the table of contents generation for that page. This would ideal for sites that have a small handful of pages that don’t need the index.

      Another option to apply would be to increase the number of headings needed before the table of contents is displayed. If you find that your learning modules have say 6 or more headings and the rest of your normal pages has less, then try setting that option to 6 in the options page (Settings > TOC+).

      I imagine the [no_toc] approach would be an ideal solution for you.

      I am working towards an inverse approach eg having the index disabled by default and only displaying it if you have something like [TOC] in your content. This would be ideal sites that only need the table of contents on a small handful of pages.

      Hope that helps.

      • Hey, thanks for the reply. The plugin looks really slick and the inverse approach is exactly what we’re looking for (i.e. with the exception of roughly 10 pages, no other ones will have toc). I’ll keep a lookout for that release.


        p.s. this font is great! what is it?

      • Mike T says:

        According to CSS declaration for it, the font is most likely Helvetica Neue:

        “Helvetica Neue”,Helvetica,Arial,sans-serif

        It’s the default one for the new Twenty Eleven theme which came with WordPress 3.2

      • Hi, love your table of content plugin however, I’m looking at pages with long article page to have the table of content box scroll along with #content to the exact location. For instance, I clicked on one of the headings on the TOC box and it scroll/jump to that page but the TOC is out of nowhere and if the article is a long one, you sure people wont want to start scrolling up to click the next title. Something that works like widget the move down along the side. Hope you catch my drift? Thanks for all the care.

    • Thank you very much for this plugin. It seems to work very well, although I do have a problem: When pressing the headers in the TOC, it seems to move just a line or so beneath the header. Is there any way to change this, so that it moves to where the header itself is? I have testing it both being logged in and off as administrator, but the problem seems to persist.

  38. Pingback: Michael T pƄ "Indholdsfortegnelse Plus" - CyberMaster

  39. Pingback: Announcing Table of Contents Plus | dublue

Comments are closed.