Jalandhar Table of Contents generates a table of contents from the headings in your post or page, so readers can jump straight to the section they came for instead of scrolling through the whole article. It works automatically once activated, or you can place it exactly where you want with a shortcode, a Gutenberg block, or a widget.
Every link points to a real, semantic anchor on the heading itself, and the whole table is wrapped in a proper <nav> landmark – so it is just as useful to search engines and screen readers as it is to a human reader scanning the page. Long-form content, guides, FAQs, and recipe or review posts all tend to rank and read better with a well-structured table of contents.
<ul>/<li> (or <ol>/<li>) lists inside a <nav> landmark, with anchor links that search engines may use for jump-to-section links in results.[jptoc] shortcode, the Gutenberg “Table of Contents” block, a widget, or the classic editor toolbar button.example.com/faq/#How_Do_This) instead of random IDs, with options to convert them to lowercase and use dashes.aria-expanded on the show/hide toggle and an aria-label on the <nav> landmark.To automatically insert a table of contents into your posts, enable “Auto Insert Table of Contents” under the plugin’s “Auto Insert” settings tab, then choose which post types should get one.
Supported positions:
If you would rather place the table of contents yourself, use any of the following:
[jptoc] shortcode, anywhere in your content.By default, each heading’s anchor is generated from its text (for example, #How_Do_This), so links are readable instead of arbitrary. Under the “Misc.” settings tab, in the “Hash” section, you can choose the anchor format (as heading, as heading without transliterate, or a counter such as #jptoc1), convert anchors to lowercase, and replace underscores with dashes.
For non-English websites using the “As heading” format, enabling the Intl PHP extension is recommended so anchors transliterate correctly.
Jalandhar Table of Contents has been tested for compatibility with:
jptoc_before and jptoc_afterAdd custom HTML immediately before or after the table of contents.
Example:
add_filter('jptoc_before', function ($before) {
return '<p>Example text before TOC.</p>' . $before;
});
jptoc_shortcode_tagChange the shortcode tag from the default [jptoc].
Example:
add_filter('jptoc_shortcode_tag', function ($tag) {
return 'toc';
});
jptoc_heading_idCustomize the anchor ID generated for each heading.
Example:
add_filter('jptoc_heading_id', function ($id, $label) {
return $id;
}, 10, 2);