Getting Started with Tidy Table of Contents

This guide walks you through installing Tidy Table of Contents, configuring heading levels and display options, and customizing the TOC for your site.

1. System Requirements

Before installing Tidy Table of Contents, make sure your WordPress environment meets the following requirements:

  • WordPress 6.0 or higher — Tidy Table of Contents uses modern WordPress APIs. We recommend running the latest version.
  • PHP 8.2 or higher — The plugin uses modern PHP features including typed properties and enums.

Tidy Table of Contents is compatible with all well-coded WordPress themes. The TOC is rendered as semantic HTML with ARIA roles, ensuring accessibility across all themes and devices.

2. Installation

Option A: Install from the WordPress Plugin Directory

  1. In your WordPress admin, go to Plugins → Add New.
  2. Search for "Tidy Table of Contents" in the search bar.
  3. Click Install Now next to the Tidy Table of Contents plugin.
  4. Once installed, click Activate.

Option B: Manual Upload

  1. Download the Tidy Table of Contents plugin ZIP file from your account dashboard or the WordPress plugin directory.
  2. In your WordPress admin, go to Plugins → Add New → Upload Plugin.
  3. Choose the ZIP file and click Install Now.
  4. Once installed, click Activate.

After activation, the table of contents will automatically appear above the first H2 heading in your posts. No additional setup is required for the default behavior. You can fine-tune the settings under Settings → Tidy TOC.

3. Configuration

Navigate to Settings → Tidy TOC in your WordPress admin. Here you can configure how the table of contents is generated and displayed.

  • Heading depth — Choose which heading levels to include. The default is H2 and H3. You can include up to H6 for deeply nested content.
  • Position — Where the TOC appears in the content: before the first heading (default), after the first paragraph, or at the top of the post.
  • Title — Customize the TOC heading text. Defaults to "Table of Contents".
  • Open collapsed — Choose whether the TOC starts expanded or collapsed. Collapsed is useful for long posts where the TOC might dominate the page.
  • Minimum headings — Set the minimum number of headings required before a TOC is generated. Default is 3, so short posts without enough structure will not show a TOC.
  • Smooth scroll — Enable smooth scrolling when clicking TOC links. Enabled by default.
  • Post types — Choose which post types display a TOC. By default, only posts are enabled.

4. Per-Post Control

When editing a post, you will see a Tidy TOC meta box in the editor sidebar. This lets you control the TOC on a per-post basis:

  • Disable TOC — Hide the table of contents for this specific post, even if the global settings would show one.
  • Override heading depth — Use a different heading depth for this post than the global setting.

This is useful for posts where a TOC is not needed (e.g., short announcements) or where you want to show deeper heading levels than usual.

5. Manual Placement

If you prefer to control exactly where the TOC appears, disable auto-insertion in the settings and use one of these methods:

  • Shortcode — Place [smart_toc] anywhere in your content to render the TOC at that exact position.
  • Gutenberg block — Add the Tidy Table of Contents block in the editor. The block uses server-side rendering to show a live preview of the TOC.

6. Accessibility & Performance

Tidy Table of Contents is built with accessibility and performance in mind:

  • ARIA roles — The TOC uses proper ARIA navigation roles, making it fully accessible to screen readers.
  • Keyboard navigation — All TOC links are keyboard-navigable.
  • Cached output — The TOC HTML is cached per post, so it does not need to be regenerated on every page load.
  • Responsive design — The TOC is collapsible on mobile devices, saving screen space while remaining accessible.