WordPress Table of Contents Plugin (CMTOC) - How To - Manually Place the Table of Contents Within a Page


Manually placing Table of Contents within Pages / Posts

Back to User Guides

By default the Table of contents is generated at the very top of the Page or Post where it is displayed. There are some occasions when you might prefer to place it somewhere else on the page as well as or instead of at the top. The WordPress Table of Contents plugin supports the following shortcode (available in the Table of Contents section of the page editor just below the text editor input area):

[cmtoc_table_of_contents]

Although placing this shortcode in the content using the Visual editor will normally work it is advisable to switch to the plain text editor before attempting to use this.

Text editor - WordPress TOC Plugin
Text editor
Scroll through the content until you reach the place where you would like to display your second (or third, or fourth...) Table of Contents. In this case we'll place another one at the very bottom to make content navigation a little easier.
Paste in the shortcode given above, remember the square brackets.
Adding shortcode - TOC Table of Contents WordPress Plugin
Adding shortcode
Click the Update button on the right to save the changes.

Now we have a Table of Contents at the top of the page by default and also one at the bottom of the page that we have placed manually.

Example of the TOC in the custom place - WordPress Table of Contents
Example of the TOC in the custom place

Hiding default Table of contents (at the top)

Should you wish to only display the manually positioned Table of Contents using the shortcode and to hide the default table of contents automatically displayed at the top the process is very simple.
On the page editor for the page that you wish to hide the default automatic display scroll down to the CM Table of Contents - Custom Selectors section below the text editor. Check the box beside the option: Disable automatic displaying of TOC at top of the post/page and display TOC only with the shortcode [cmtoc_table_of_contents] (overwrite the general settings).
Disabling automatic displaying of TOC - Table of Contents WordPress
Disabling automatic displaying of TOC

Scroll up a little and click the Update button to save the changes.

Saving the changes - WordPress Table of Contents Block
Saving the changes

More information about the WordPress Table of Contents Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.