1. Home
  2. Getting Started
  3. Easy Table of Contents – Shortcode Documentation

Easy Table of Contents – Shortcode Documentation

The Easy Table of Contents shortcode feature allows users to embed a fully customizable Table of Contents (TOC) anywhere within their post, page, or custom content. This is especially useful for websites that require flexible placement of the TOC or need different TOC configurations on individual pages.

Shortcodes offer complete control over TOC behavior, appearance, and functionality. Whether you want to display a title, show or hide the toggle, load on specific devices, or include/exclude certain headings — these parameters make it simple.

Why Use TOC Shortcodes?

Shortcodes are powerful because they:

  • Give full flexibility over TOC placement.
  • Allow custom configurations per page or per section.
  • Help control visibility based on devices.
  • Provide advanced controls like exclusion, initial visibility, heading levels, etc.
  • Let you add the TOC inside custom layouts, Elementor blocks, or themes.

Use Cases:

  • Websites using page builders where auto-insert may not work.
  • Long-form articles needing TOC placed midway.
  • Custom landing pages with selective headings.
  • Mobile-optimized reading experiences.
  • Documentation pages requiring grouped sections.

Shortcodes and Their Detailed Usage

Below are all the shortcodes provided, explained with purpose and examples.

header_label – Add TOC Title

Shortcode: [header_label="Title"]

Adds a custom title on top of the table of contents.

Use Case:

  • When you want a unique TOC heading like “Quick Navigation”, “On This Page”, “Summary”, etc.

Example:

[ ez-toc header_lables = ‘contents’ ]

display_header_label – Hide Title

Shortcode: [display_header_label="no"]

Hides the TOC title completely.

Use Case:

  • When designing a minimal UI.
  • When TOC is placed inside a styled card with its own heading.

Example:

[ ez-toc display_header_label = “no” ]

toggle_view – Enable/Disable Toggle

Shortcode: [toggle_view="no"]

Removes the expand/collapse toggle.

Use Case:

  • When you want TOC always fully expanded.
  • Useful for SEO pages and documentation.

Example:

[ ez- toc toggle_view = “no” ]

initial_view – Default State (Show/Hide)

Shortcodes:

  • [initial_view="hide"]
  • [initial_view="show"]

Controls whether the TOC is visible or collapsed by default.

Use Case:

  • Hide by default for mobile users.
  • Show by default for long blogs.

Example:

[ ez-toc initial_view = “hide” ]

display_counter – Show/Hide Number Counter

Shortcode: [display_counter="no"]

Hides numbering from the TOC items.

Use Case:

  • When headings should appear clean without numbering.
  • Works well for design‑focused pages.

Example:

[ ez-toc display_counter = “no” ]

post_types – Restrict TOC to Specific Post Types

Shortcode: [post_types="post,page"]

Allows the TOC to scan specific post types.

Use Case:

  • Display only in pages.
  • Display only in blog articles.

Example:

[ ez-toc post_types = “page” ]

post_in – Show TOC Only for Specific IDs

Shortcode: [post_in="1,2"]

Loads TOC only on selected post or page IDs.

Use Case:

  • Using shortcode inside global templates.
  • Testing TOC on specific pages.

Example:

[ ez-toc post_in = “12, 15, 20” ]

device_target – Device-Specific TOC

Shortcode: [device_target="desktop"]

Supports both:

  • desktop
  • mobile

Use Case:

  • Show TOC only for desktop users.
  • Reduce clutter on mobile.

Example:

[ ez-toc device_target = “mobile” ]

view_more – Limit Headings (PRO)

Shortcode: [view_more="5"]

Loads only 5 headings initially, and shows the rest after clicking “View More”.

Use Case:

  • Long documentation pages.
  • Improve readability.
  • Lighten the UI for mobile.

Example:

[view_more = “5” ]

class – Add Custom CSS Class

Shortcode: [class="custom_toc"]

Allows styling your TOC using your own CSS.

Use Case:

  • Match theme design.
  • Add custom borders, padding, fonts.

Example:

[ class = “blue-toc” ]

exclude – Exclude Specific Headings

Shortcode: [exclude="Test"]

Excludes headings containing specific words.

Use Case:

  • Hide unwanted headings (ads, widgets, autogenerated text).
  • Exclude headings like “Summary”, “FAQ”, etc.

Example:

[ ez-toc exclude = “FAQ” ]

heading_levels – Specify Which Heading Levels to Include

Shortcode: [heading_levels="2,3"]

Controls which headings (H1–H6) are shown.

Use Case:

  • Show only H2 & H3 for clean navigation.
  • Exclude deeper headings like H4–H6.

Example:

[ ez- toc heading_levels = “2, 3” ]

Using Easy Table of Contents shortcodes gives full control over how your TOC appears and behaves across different pages, devices, and layouts. Whether you’re creating professional documentation, long‑form content, or optimized mobile pages these shortcode options ensure flexibility, custom design, and improved user experience.

If you need help customizing any specific use case or shortcode combination, feel free to to reach out to us!

Updated on November 27, 2025

    Are you still looking for a solution?

    Then fill out the below form and we will reach out to you within a few hours.


    Was this article helpful?

    Related Articles

    Need Support?
    Can’t find the answer you’re looking for? Don’t worry we’re here to help!
    Contact Support