VenDoor Sticky Table of Contents

VenDoor Sticky Table of Contents builds a floating index from the headings of your article and keeps it beside the text while the reader scrolls. The section being read is highlighted, subsections fold away until they are needed, and the panel stays inside the bounds of the article instead of floating over your header or footer. On phones and tablets it becomes a bottom sheet.

No anchor URLs. That is the point.

Most table of contents plugins give every heading an id and link to it with <a href="#section">. Search engines follow those links and start reporting yourpost/#some-heading as a result of its own. Those fragments compete with the article in Search Console and split the picture of how the page is really performing.

This plugin does neither. Items are buttons, your headings keep the markup you wrote, and scrolling is done by holding a reference to the heading itself. location.hash is never touched, so no fragment URL is ever created, linked or shared.

What you get

  • A floating panel anchored to the edge of your content, not to the window.
  • Scroll-spy: the current section is highlighted as you read.
  • H3 subsections collapse under their H2 in an accordion.
  • A bottom sheet on phones and tablets.
  • Markers in the margin pointing at the section you are on.
  • It appears only when an article actually has enough headings to need one.
  • Keyboard accessible, honours prefers-reduced-motion, hidden when printing.
  • Ten languages plus right-to-left support.

No settings page

The plugin works out of the box and everything worth changing is a filter, so your configuration lives in your theme rather than in the database.

FilterWhat it changesDefault
sticky_toc_enabledWhether the assets load on this request—
sticky_toc_post_typesWhich post types get a table of contentsarray( 'post' )
sticky_toc_content_selectorThe element holding the article body.entry-content
sticky_toc_heading_selectorWhich headings are listedh2, h3
sticky_toc_min_headingsHeadings needed before it appears3
sticky_toc_scroll_offsetGap left above a heading, in pixels90
sticky_toc_mobile_breakpointWidth below which it becomes a bottom sheet1024
sticky_toc_top_selectorsTop boundary the panel may travel to—
sticky_toc_bottom_selectorsBottom boundary the panel may travel to—

For example, to point it at a theme that does not use .entry-content:

add_filter( 'sticky_toc_content_selector', function () {
    return '.my-article-body';
} );

Languages

English is the source language. Japanese, Spanish, German, French, Portuguese (Brazil), Russian, Italian, Dutch, Polish and Turkish ship with the plugin — chosen by WordPress install share rather than by number of speakers, because this plugin lives inside WordPress. Right-to-left locales are fully supported: the panel, the rail and the paddings all mirror.

Requirements

  • WordPress 6.0 or later
  • PHP 7.4 or later
  • Released under the GPL, version 2 or later

Availability

Version 2.0.0 is complete and on its way to the WordPress plugin directory. This page will link to the listing once it is published there. In the meantime, write to us if you would like a copy.