Hydrogen SEO 0.0.31: Table of Contents, HTML Sitemap, Pillar Content and Crawl Cleanup

A Table of Contents block, an HTML sitemap block, pillar content with an under-linked filter on the Posts screen, and optional crawl cleanup switches.

In this article 8 sections
  1. Table of Contents block and shortcode
  2. HTML sitemap
  3. Pillar content
  4. Crawl cleanup
  5. Import SEO Data
  6. For developers
  7. Performance
  8. After updating

Hydrogen SEO 0.0.31 adds four things. A Table of Contents block and shortcode list a post's headings as links and add the anchors they point to. An HTML Sitemap block and shortcode put a visitor-facing list of your content on any page, limited to what your XML sitemap includes. Pillar content lets you mark your most important pages, see them on the Posts screen and filter for the ones with too few internal links. And Crawl cleanup is a set of fourteen switches that remove tags, headers and feeds WordPress adds by default. Import SEO Data now brings pillar and cornerstone flags across. Everything here is free and needs no account.

Update from Plugins → Installed Plugins as usual. Unlike 0.0.30, this release changes nothing by itself: no page of your site looks different after the update until you add a block, mark a page or turn a switch on.

Table of Contents block and shortcode

Long posts are easier to use with a list of their sections at the top. Until now that meant a separate plugin or a hand-written list of links that broke whenever a heading changed.

Insert the Table of Contents block (in the Design category of the inserter) or type [hydrogen_seo_toc], and the post gets a nested list of its headings, each linked to its section. Headings that have no id get one, made from their text; headings that already have an HTML anchor keep it.

Three options, the same in the block's sidebar and as shortcode attributes:

  • Title (title): the text above the list, "Table of contents" by default. Leave it empty to show no title.
  • Heading levels (levels): H2 and H3 by default, up to H6. The shortcode takes 2,3,4 or a range such as 2-4.
  • List style (list_style): numbered or bulleted.

To leave one heading out, give it the CSS class hydrogen-seo-toc-exclude.

Things to know:

  • Only posts that use it are touched. Anchors are added to a post's headings only when the post contains the block or shortcode. Every other page is returned as it was, without being parsed.
  • No JavaScript. The list is plain links inside a <nav> element, with three short layout rules printed inline. Your theme styles the rest.
  • The list is built from the published page, so it includes headings printed by other blocks and shortcodes. The preview in the editor is built from the post's Heading blocks, so it can be shorter than the published list on such posts.
  • Paginated posts list the headings of the page being viewed, and nothing is printed in feeds.

Reference: table of contents block and shortcode. Background: how to add a table of contents to WordPress posts, and when it helps.

HTML sitemap

An XML sitemap is for search engines. An HTML sitemap is a page for people: every section of the site as a list of links.

Add the HTML Sitemap block or [hydrogen_seo_html_sitemap] to a page and it lists your pages, posts and other content, one section per post type. Pages are nested under their parents. By default it lists every post type that is switched on in your XML sitemap settings, pages by title and posts newest first.

The attributes, also available as block settings:

  • post_types and taxonomies: comma lists of what to include. Taxonomies are not listed unless you ask for them.
  • orderby (title, date or modified) and order (asc or desc).
  • show_dates: print each entry's date.
  • limit: entries per section, 500 by default and at most 2000.
  • heading_level: the level of the section headings, 2 to 6.

Things to know:

  • It lists only what the XML sitemap includes. Noindex, private, draft and password-protected content is always left out, and a post type that is switched off in the Sitemap settings cannot be listed. The page will not link to something you have asked search engines to skip.
  • It is cached with the XML sitemap and rebuilt when content changes.
  • It adds no script and no stylesheet. The lists take your theme's styles.

Reference: HTML sitemap block and shortcode. Background: HTML sitemap vs XML sitemap: who each is for.

Pillar content

Every site has a few pages that matter more than the rest. The link counts added in 0.0.30 show how many posts link to each page; what was missing was a way to say which pages those counts matter most for.

Open a post's SEO Settings sheet, go to Robots Meta and switch on Pillar content. On the Posts screen:

  • Marked posts show a Pillar badge in the SEO column.
  • The All SEO filter has a Pillar content option that lists them.
  • A second option, Pillar content with fewer than 3 incoming links, lists the marked posts that fewer than three other published posts link to.
  • Quick Edit has a Pillar content checkbox, and Bulk Edit a Pillar content choice to mark or unmark many posts at once.

Things to know:

  • The under-linked filter needs the internal link counter. It is offered only while Count Internal Links is on under Hydrogen SEO → General → Links, and a post that has not been counted yet is not listed.
  • Marking a page changes nothing visitors or search engines see. It is a label for you. What helps the page is the links you add after reading the list.
  • Three is the default. Developers can change it with the hydrogen_seo_pillar_min_incoming_links filter.

Reference: pillar content. Background: pillar pages and internal links: finding the under-linked ones.

Crawl cleanup

WordPress prints several tags in every page's head for features many sites never use, and creates a comments feed for every post. Hydrogen SEO → General → Crawl cleanup has fourteen switches, all off, in four groups:

  • Head tags: remove shortlinks, REST API links, the RSD link, oEmbed discovery links, the generator tag, the emoji script and styles, and ?replytocom= from comment reply links.
  • Feeds: remove the comments feed link, post comments feed links, and archive and search feed links from the head. The feeds themselves stay available.
  • Feeds: turn off and redirect: turn off the comments feed, post comments feeds or search result feeds. Each redirects (301) to the page it belongs to.
  • Headers: remove the pingback header and tag.

Things to know:

  • Your main feed is never changed or redirected.
  • Removing the REST API link does not turn off the REST API. The editor and other plugins keep working.
  • The reply-link switch relies on your theme's comment-reply script for threaded replies, which most themes load. Without it, a reply is posted as a new comment.
  • A pingback tag written directly into a theme's header file stays. The switch removes the header and the tag from themes that print it the standard way, and it does not turn off XML-RPC.
  • We make no speed or ranking claim for any of this. The practical gain is fewer addresses for crawlers to fetch on sites with many posts and comments, and a head that is easier to read.

Reference: crawl cleanup. Background: cleaning up the WordPress head: what each tag is and whether you need it.

Import SEO Data

The importer under Tools now also brings across pillar and cornerstone flags from Yoast SEO, Rank Math and All in One SEO, so pages you had marked in your previous plugin arrive marked as pillar content. A flag held on a category or tag is listed in the report, since pillar content is for posts and pages.

The preview lists every value before anything is saved, and Undo restores what you had. See the import guide.

For developers

Each feature has filters, documented with examples on its page and in the filters reference:

  • Table of contents: hydrogen_seo_toc_headings, hydrogen_seo_toc_html, hydrogen_seo_toc_inline_css, hydrogen_seo_toc_max_entries, hydrogen_seo_toc_reserved_ids.
  • HTML sitemap: hydrogen_seo_html_sitemap_query_args, hydrogen_seo_html_sitemap_html.
  • Pillar content: hydrogen_seo_pillar_min_incoming_links.
  • Crawl cleanup: hydrogen_seo_crawl_cleanup, hydrogen_seo_crawl_cleanup_feed_redirect.

Performance

A post without a table of contents is not parsed, and one with it is read once when the page is built. The HTML sitemap runs no query on pages that do not contain it and is served from a cache on the page that does. Pillar content reads and prints nothing on the front end. Crawl cleanup hooks nothing while every switch is off, and with switches on it unhooks WordPress's own callbacks. None of the four adds a script to your pages.

After updating

  1. Add a table of contents to your two or three longest guides and check each on a phone. If your theme has a sticky header, add scroll-margin-top to headings so they are not hidden after a jump.
  2. Decide whether your site needs an HTML sitemap. If it has a deep page structure, create a Sitemap page with the block and link it from the footer.
  3. Mark your pillar pages, then open the under-linked filter once the link count has finished and add links from related posts.
  4. Read through Crawl cleanup before switching anything on. View a page's source first, turn on the switches for things you know you do not use, and view the source again.