Mocursor Smart TOC
Mocursor Smart TOC is a lightweight, feature-packed Gutenberg block that automatically generates a linked table of contents from the headings in your posts and pages. Simply drop it into your content — it just works. Also available as a [mctoc] shortcode for classic editor users. The block is fully
Mocursor Smart TOC is a lightweight, feature-packed Gutenberg block that automatically generates a linked table of contents from the headings in your posts and pages. Simply drop it into your content — it just works. Also available as a [mctoc] shortcode for classic editor users.
The block is fully dynamic , accessible , lightweight , and theme-aware . It uses WordPress design tokens and CSS custom properties so it inherits your theme’s colors, fonts, and spacing automatically.
Shortcode Support
The Mocursor Smart TOC block is also available as a [mctoc] shortcode for use in the classic editor, widgets, or theme templates.
Basic usage:
[mctoc]
With options:
[mctoc title="On This Page" include_h2="true" include_h3="true" include_h4="false" numbering="nested" collapsed="true" sticky="true" offset="100" skip="1" exclude_headings="Related Posts,Comments" back_to_top="true" align="right" justify=""]
Available shortcode attributes:
- title — TOC heading text (default: “Table of Contents”)
- include_h2 — Include H2 headings: “true” or “false” (default: “true”)
- include_h3 — Include H3 headings: “true” or “false” (default: “true”)
- include_h4 — Include H4 headings: “true” or “false” (default: “true”)
- exclude_headings — Comma-separated heading texts to exclude
- numbering — Numbering style: “none”, “decimal”, or “nested” (default: “none”)
- collapsed — Start collapsed: “true” or “false” (default: “false”)
- sticky — Enable sticky mode: “true” or “false” (default: “false”)
- offset — Scroll offset in pixels for fixed headers (default: 80)
- skip — Number of headings to skip from the start (default: 0)
- back_to_top — Show “Back to Top” link: “true” or “false” (default: “false”)
- align — Floating block alignment: “left”, “center”, or “right”. Left/right allow nearby content to wrap beside the TOC.