Back to Community

How to Exclude Headings from Your Easy Table of Contents

27 threads Sep 16, 2025 PluginEasy table of contents

Content

A common challenge for users of the Easy Table of Contents plugin is preventing unwanted headings from appearing in the generated table. This often happens when other plugins or theme elements, such as related posts, author boxes, or product sliders, insert their own headings into the page content. The plugin scans the entire post content, and these external headings can be unintentionally included.

Fortunately, the plugin provides several built-in methods to exclude specific headings, giving you control over what appears in your table of contents.

Method 1: Exclude Headings by Text

The most straightforward method is to use the Exclude Headings field found in the plugin's main settings or within the meta box on individual posts and pages. You can enter headings you want to ignore, separated by a pipe | character.

You can use wildcards for more flexibility:

  • Fruit*: Ignores headings starting with "Fruit"
  • *Fruit Diet*: Ignores headings containing "Fruit Diet" anywhere in the text
  • Apple Tree|Oranges: Ignores headings that are exactly "Apple Tree" or "Oranges"

For example, to exclude a newsletter sign-up section with the headings "Join the Journey" and "Sign up," you would enter: Join the Journey*|*Sign up*

Method 2: Exclude Headings by CSS Class or ID (Advanced)

If the headings you want to exclude are generated by another plugin or theme component, they often have a unique CSS class or ID assigned to them. The Easy Table of Contents plugin can target these selectors to exclude them.

To enable this feature:

  1. Navigate to the Easy TOC settings in your WordPress admin dashboard.
  2. Click on the Advanced tab.
  3. Enable the options for Exclude Headings by Class and/or Exclude Headings by ID.
  4. Save your changes.

Once enabled, the plugin will automatically ignore any heading that has a class or ID attribute. For instance, if a related posts plugin outputs headings with class='related-post-title', those headings will be skipped. This is a powerful way to exclude entire sections without having to list every possible heading title.

Method 3: Disable Auto-Insert for Specific Posts

If you do not want a table of contents to appear on a specific post or page at all, you can disable it individually. This is useful for excluding entire content types, like recipe posts.

  1. Edit the post or page where you want to remove the TOC.
  2. Scroll down to the Table of Contents meta box.
  3. Check the option to Disable the insertion of the table of contents for this page.
  4. Update or publish the post.

Troubleshooting Common Issues

  • Exclusions Not Working with [ez-toc] Shortcode: Some users have reported that exclusion rules work with the old [toc] shortcode but not with the newer [ez-toc] shortcode. If you encounter this, try switching shortcodes to see if it resolves the issue.
  • Long Exclusion Lists: The "Exclude Headings" field can accept a large number of entries, but very long lists may become difficult to manage. Using the Exclude by Class method is often a more efficient long-term solution for excluding headings from plugins.
  • Dynamic Content: Content added dynamically after the page loads (e.g., via JavaScript) typically cannot be excluded, as the plugin scans the content when the page is generated on the server.

By using these exclusion methods, you can fine-tune your table of contents to display only the most relevant headings for your readers.

Related Support Threads Support