Essence Table of Contents

Description

Essence Table of Contents reads the headings in a post and shows a list the reader can click, before the first heading or wherever you put it. Set it once for the whole site and change it on any post that needs something different.

It is built for the posts that actually need a contents list: the long ones.

No JavaScript at all on the front end

The fold is the browser’s own control, so it works with JavaScript switched off, on every screen reader, and with no risk of trapping the keyboard. Smooth scrolling and the offset for a fixed header are two lines of CSS, and the smooth scrolling turns itself off for readers who have asked their device for less motion. There is no script to load, nothing to run, and nothing for a caching or minifying plugin to break.

Fast on a very long post

The headings are read on the server in a single pass over the content, with no document tree and no regular expression over the body. A 20,000-word post with 200 headings is read in about three milliseconds on PHP 7.4, and the benchmark that proves it runs with every release. The list is part of the page, so a page cache keeps it and nothing is requested after the page loads.

It looks like your theme, not like a plugin

By default it sets no colours, no border, no background and no typeface: the list takes the lot from your theme. If you want a box there are three, and you can set your own colours. There is no decorative CSS to override.

What the reader gets

  • A list of the headings, nested, numbered if you like.
  • A link to every heading they can copy and share.
  • A fold, if you want one, that remembers nothing and needs no script.
  • Proper markup: a labelled navigation landmark holding real lists, checked against WCAG 2.2 AA.

What you set, once

  • Where the list goes: before the first heading, after the first paragraph, after a number of paragraphs, at the top, at the bottom, or nowhere automatic.
  • Which kinds of content get one.
  • Which heading levels are listed. h1 is your title, so it is never listed.
  • How many headings a post needs before it gets a list.
  • The title, whether the list folds, where the fold’s arrow sits, and whether it starts folded.
  • Numbering: none, 1 2 3, 1 1.1 1.2, roman or lower-case roman, flat or nested, or a bullet.
  • Headings to skip, by text with a wildcard or by a class you name.
  • Width, alignment, and a box if you want one.
  • How the anchors are written.

Moving from another plugin

If your site runs LuckyWP Table of Contents or Easy Table of Contents, Settings, Table of Contents has a tab that reads their settings and your posts’ own choices and shows you exactly what each one becomes, before anything is written. Then one button does it, and another puts your old settings back.

The important part: it keeps the anchor format your old plugin used, so every link anyone has ever shared to a section of your posts goes on working. Your old plugin is not changed and not switched off; that is yours to do once you have looked at your pages. The shortcodes already in your posts keep showing a list too.

Placing a list by hand

A block, a shortcode and a widget, so you can put a list where you want it, including in a page builder. The shortcode is [essence_toc] and takes title, levels, min, numbering, collapsible and class.

What it does not do

It does not change your headings: the anchors are added when the page is shown. It does not touch schema, sitemaps or any other SEO setting; a contents list is for readers, and search engines find the anchors by themselves. It sends nothing anywhere, shows no notices in your admin, and asks you for nothing.

Screenshots

Blocks

This plugin provides 1 block.

  • Table of contents A list of this post's headings, built when the page is shown. Use it where you want the list rather than letting the plugin place one.

Installation

  1. Install and activate the plugin.
  2. Write or open a post with three or more headings and look at it. There is already a list before the first heading.
  3. To change anything, go to Settings, Table of Contents.
  4. Moving from another plugin: the second tab on that page.

FAQ

Will the links people have shared to my sections still work?

Yes, if you use the move from your old plugin. It sets the anchor format that plugin used, so the anchors come out exactly as they did, down to the way a repeated heading is numbered. The report tells you so before you commit to anything.

What happens to a link when I reword a heading?

Nothing: it keeps working. Each post remembers the anchors it has, so rewording or reordering a heading does not change its link. A new heading gets a new one. You can switch that off, and you can always set a heading’s anchor by hand with the block editor’s own HTML anchor field, which always wins.

Does it load any JavaScript?

None. The only thing it adds to a page is about four kilobytes of CSS, printed in the page itself so there is no extra request, and only on pages that have a list.

Will it slow a long post down?

No. A 20,000-word post with 200 headings is read in about three milliseconds, and ten times the post costs about ten times that, not a hundred. There is a benchmark in the test suite that fails the release if that changes.

Does it work with my theme?

It should, because it adds nothing of its own to style. It is tested on Storefront, Astra, Kadence, GeneratePress and the current default block theme, in both the block and the classic editor.

Does it work with Elementor, Divi or YOOtheme Pro?

Yes. Where a page builder draws the post content itself, the automatic placement works as usual. Where it does not, put the [essence_toc] shortcode or the Table of contents block where you want the list.

Can I have a list in my sidebar?

Yes, with the widget, or with the block in a widget area on a block theme.

Can I turn it off for one post?

Yes. Every post has a Table of Contents panel in the editor, where you can switch the list off or give that post its own title, placement, levels, minimum or skipped headings.

Does it put a list on category and tag pages?

No. It works on single posts and pages. A contents list for an archive of many posts is a different thing and not something this plugin does.

Does it send anything anywhere?

No. Nothing leaves your site, there is no account, and there are no notices or upsells in your admin.

What happens if I delete it?

Every setting and every piece of post data it made is removed. Your headings and your content are untouched, because it never changed them.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Essence Table of Contents” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.1.1

  • The stylesheet is now handed to WordPress with wp_add_inline_style() rather than printed as a style tag of our own. It is still printed in the page, so there is still no extra request, and still only on pages that have a list.

0.1.0

  • First release.