Simple WP Table of Contents Block
Simple WordPress Table Of Content Block
by Samuel Sena · github.com/ironlady/simple-wp-table-of-content
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ironlady/simple-wp-table-of-content/archive/refs/heads/main.zipAdd a dynamic table of contents block with block sidebar controls for managing which core Heading blocks are included.
Description
Simple WP Table of Contents Block keeps the editing workflow simple:
- adds a Table of Contents block to the inserter
- works with the core Heading block only
- lists every heading from H1 through H6 in document order
- lets editors exclude headings from the table of contents
- adds stable, unique anchor IDs to included headings when the post is saved
- renders the table of contents dynamically from the current post content
- keeps the heading controls inside the selected Table of Contents block settings
The project source is maintained in src/, with the production assets generated from that source during the build step.
Installation
- Upload the plugin files to the
/wp-content/plugins/simple-wp-tocdirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the
Pluginsscreen in WordPress. - Insert the
Table of Contentsblock where you want the navigation to appear. - Select the
Table of Contentsblock and use its block settings sidebar panel to include or exclude headings.
Frequently Asked Questions
Which headings are supported?
The plugin only reads the core Heading block and supports levels H1 through H6.
Does it add front-end markup by itself?
Yes. The block renders a nested list of links from included Heading blocks in the current post.
Does it work without the Table of Contents block inserted?
No. Heading syncing starts when a Table of Contents block is present in the post editor.
Changelog
1.0.0
- Initial release.