HTML Sitemap vs XML Sitemap: Who Each One Is For

An XML sitemap is a file for search engines; an HTML sitemap is a page for visitors. What each does, whether you need both, and how to build one in WordPress.

In this article 8 sections
  1. The short version
  2. What an XML sitemap does
  3. What an HTML sitemap does
  4. Do you need both?
  5. Mistakes that make an HTML sitemap worse than none
  6. Building an HTML sitemap in WordPress
  7. How the two work together
  8. Common questions

"Sitemap" names two different things. An XML sitemap is a file that lists your URLs for search engines. An HTML sitemap is a page that lists your content for people. They share a name and a rough purpose, helping something find its way around your site, and almost nothing else. This guide sets out what each one does, who reads it, whether you need both, and how to build an HTML sitemap in WordPress that stays correct without upkeep.

The short version

XML sitemapHTML sitemap
Read bySearch engine crawlersVisitors, and crawlers following links
FormatAn XML file, usually an index of several filesA normal page on your site
Lives atAn address such as /sitemap.xmlA page such as /sitemap/, linked from the footer
ContainsEvery URL you want indexed, with last-modified datesLinks to your pages, grouped in a way people can scan
Counts as internal linksNoYes, they are ordinary links
Submitted to search enginesYes, in their webmaster toolsNo, it is crawled like any page
Needed byAlmost every siteSites with a deep or wide structure

If you remember one line: the XML sitemap says these URLs exist, and the HTML sitemap says here is how to get to them.

What an XML sitemap does

An XML sitemap is a list of addresses in a format crawlers read. It tells a search engine which URLs you consider worth indexing and when each last changed. Search engines use it to discover pages they have not found through links and to decide what to fetch again.

What it does not do:

  • It does not make a page rank. Listing a URL is an invitation to crawl it, not a vote for it.
  • It does not replace links. A page that is in the sitemap and linked from nowhere is still an orphan: the search engine knows the address and nothing about how the page relates to the rest of the site.
  • Visitors never see it.

WordPress has produced a basic XML sitemap by itself since version 5.5, and SEO plugins replace it with one that leaves out noindex content and adds image entries. What belongs in it, and what never should, is covered in our XML sitemap guide. You can check a sitemap's format with the free XML sitemap validator.

What an HTML sitemap does

An HTML sitemap is a page. It lists the site's sections and pages as links, usually grouped: pages in their hierarchy, then posts, perhaps categories.

It does two jobs:

  1. For visitors, it is a fallback map. Someone who cannot find a page through the menu or search looks for "Sitemap" in the footer. On a large site it is how people reach policy pages, old documentation and anything that fell out of the navigation.
  2. For crawlers, it is a page full of internal links. Every entry is a normal link, so a page that was six clicks from the homepage becomes two clicks away: homepage, sitemap, page. That shortens crawl depth for content that is otherwise buried.

The second job is real and easy to overstate. A link from a list of five hundred others carries little context. It tells a search engine the page exists and is part of the site, which an XML sitemap already does. It does not say what the page is about the way a link inside a relevant paragraph does. An HTML sitemap is a safety net under your internal linking, and the linking still has to be done.

Do you need both?

The XML sitemap: yes, with few exceptions. It costs nothing and it is how search engines keep up with a site that changes.

The HTML sitemap: it depends on the shape of the site.

It is worth having when:

  • the site has many pages in a hierarchy several levels deep, such as documentation, a university or council site, or a large service business with location pages
  • there are years of content and the navigation only reaches the recent part
  • the footer is expected to carry one, as it is on many institutional and e-commerce sites
  • you have pages that are useful and belong in no menu

It adds little when:

  • the site has a few dozen pages, all reachable from the menu
  • it would simply repeat the navigation

A quick test: pick three pages at random from deep in your site and count the clicks from the homepage. If the answer is often four or more, an HTML sitemap is a cheap improvement. If it is always two, you do not need one.

Mistakes that make an HTML sitemap worse than none

Listing pages you have told search engines to skip. If a page is set to noindex, it should not be on your sitemap page either. Linking to thank-you pages, internal search results or thin tag archives sends visitors and crawlers to exactly the pages you wanted out of the way. The simplest rule is that the HTML sitemap lists what the XML sitemap lists, and nothing else.

Building it by hand. A typed list is out of date the week after it is written. New pages are missing; deleted ones are dead links. Whatever you use should build the list from the site's content each time.

One enormous flat list. Four thousand post titles in alphabetical order help nobody. Group by type, nest pages under their parents, and for large sets of posts link to the category archives and let those do the listing.

Hiding it. A sitemap page nobody links to is itself an orphan. Put the link in the footer, on every page.

Treating it as the internal linking strategy. It is the minimum. Pages that matter need links from related content; see internal linking strategy.

Building an HTML sitemap in WordPress

With core blocks

WordPress can do a basic version unaided. Create a page called Sitemap and add:

  • a Page List block, which prints every published page in its hierarchy
  • a Categories List block
  • a Latest Posts block for recent content

This updates itself, which is the main thing. Its weakness is that it does not know about your SEO settings: the Page List block lists every published page, including ones you have set to noindex, and Latest Posts shows only a recent slice.

With a block that follows your XML sitemap

From version 0.0.31, Hydrogen SEO has an HTML Sitemap block and a [hydrogen_seo_html_sitemap] shortcode built on one rule: it lists only what the plugin's XML sitemap includes. A post type switched off in the sitemap settings is not listed. A noindex, private, draft or password-protected post is never listed. The two sitemaps cannot disagree.

Add the block to a page, or the shortcode:

text
[hydrogen_seo_html_sitemap]

That lists every post type in your XML sitemap, one section each, pages nested under their parents and ordered by title, posts newest first. The options narrow it down:

text
[hydrogen_seo_html_sitemap post_types="page,post" taxonomies="category" show_dates="true" limit="200"]
  • post_types and taxonomies choose what to list. Taxonomies are left out unless you name them.
  • orderby is title, date or modified, with order as asc or desc.
  • show_dates prints each entry's date.
  • limit is the number of entries per section, 500 by default and 2000 at most.
  • heading_level sets the level of the section headings, from 2 to 6.

The list is cached and rebuilt when content changes, and the block adds no script or stylesheet. Every option, the markup and the developer filters are in HTML sitemap block and shortcode.

Laying it out

A few lines of CSS in your theme turn long lists into columns on wide screens:

css
.hydrogen-seo-html-sitemap__list { columns: 3 16rem; }
.hydrogen-seo-html-sitemap__list li { break-inside: avoid; }

Keep the section headings. They are what lets a visitor skip straight to Pages or Products.

How the two work together

On a well-kept site the two sitemaps describe the same set of pages from two sides:

  1. The XML sitemap lists every indexable URL with its last-modified date. You submit it once in each search engine's webmaster tools; see submit your sitemap to Google.
  2. The HTML sitemap lists the same content as links, on a page in the footer.
  3. Internal links in your content do the real work of saying which pages matter and what they are about.

When all three agree, a page you publish is discoverable by file, by link and in context. When they disagree, for example a page in the XML sitemap that nothing links to, you have found something to fix. The orphan pages guide covers that case.

Common questions

Does Google need an HTML sitemap? No. Google finds pages through links and XML sitemaps. An HTML sitemap helps only through the ordinary links it contains.

Can an HTML sitemap replace the XML one? No. It carries no last-modified dates, it is not submitted anywhere, and it should not list every URL on a large site.

Should the sitemap page be noindex? There is no need. It is a legitimate page. It will rarely appear in search results, and leaving it indexable lets crawlers follow its links.

How many links can it hold? There is no fixed limit that search engines publish for a page. The practical limit is the reader: past a few hundred entries per section, link to hubs and archives instead.

Is an HTML sitemap the same as a table of contents? No. A table of contents links to sections within one page. An HTML sitemap links to the pages of a site. For the first, see how to add a table of contents in WordPress.