XML and HTML sitemaps serve different purposes, so there is no universally better choice for SEO. The former is used primarily by search engine crawlers, while the latter helps visitors navigate the site. Depending on the size and structure of the site, both sitemaps may be useful—or neither may be needed.
How an XML Sitemap Works
An XML sitemap contains URLs of pages and files that search engine crawlers need help discovering and crawling. It can also include additional information, such as a video’s duration or an article’s publication date. Regular visitors have little use for this type of sitemap, except when diagnosing SEO issues.
The file helps crawlers find pages that have few internal links pointing to them or are not linked to other pages on the site at all. It can also point to recently updated content that should be recrawled.
How to Create an XML Sitemap
Most search engine crawlers understand sitemaps that follow the sitemaps.org protocol. It specifies requirements for the file’s location and schema, as well as domain ownership verification when linking between domains.
A single XML sitemap must not exceed 50 MB uncompressed or contain more than 50,000 URLs. For a larger site, you can create multiple files and group them using a sitemap index file.
A sitemap usually includes canonical URLs of pages that are accessible for crawling and indexing and return a 200 response code. However, there are exceptions to this rule. For example, when setting up redirects in bulk, a separate sitemap containing old URLs that return a 301 status code may encourage crawlers to recrawl them sooner and discover the redirects. This is especially relevant if internal links to the old URLs have already been removed.
Why You Need an HTML Sitemap
An HTML sitemap is a page containing links to other pages on the site. It is usually provided in addition to the main navigation and linked from an accessible location, such as the site footer.
It serves as a backup navigation method when a visitor cannot find the desired section through the menu or search. On a small site, it can include links to every page; on a larger one, it can include at least the most important pages.
This type of sitemap can also help search engine crawlers: by following the links, they can discover pages that are poorly connected to the rest of the site. For the sitemap to help with crawling, the links must be accessible to crawlers and, in particular, must not have the nofollow attribute. It is also worth checking whether crawling of the target URLs is blocked in robots.txt. If a crawler cannot follow the links, the sitemap itself will not cause serious problems, but it will not be able to help the crawler either.
There is no mandatory special format for an HTML sitemap: it is generally an ordinary HTML page with hyperlinks. However, a user turning to such a sitemap may indicate that the main navigation did not help them find what they needed. The sitemap should therefore complement the main navigation, not replace it.
How to Choose a Sitemap for Your Site
A small site, for example one with fewer than 20 pages, may need neither an XML nor an HTML sitemap. If all pages are well connected through the main navigation, users and search engine crawlers will probably be able to find them without additional help.
On a site with millions of pages and links buried several levels deep in menus, both sitemaps can be useful, though for different audiences. An XML sitemap gives crawlers a list of URLs to crawl, while an HTML sitemap helps visitors and crawlers find deeply buried pages.
When an XML Sitemap Is Especially Useful
An XML sitemap helps troubleshoot crawling issues. After submitting it to Google Search Console, you can receive notifications about problems with the file or the URLs listed in it and check the indexing status of those URLs. This is especially useful for very large sites.
The main costs are creating and maintaining the sitemap. Many content management systems generate one automatically. However, if creating a sitemap for a small site that search engines already crawl and index well would require significant expense or developer resources, it is not essential.
When to Use an HTML Sitemap
An HTML sitemap can be useful if navigation is unclear or site search is not comprehensive enough. It is especially useful on large sites with complex internal linking structures and, depending on how it is organized, can show relationships between pages.
That said, the need for one usually arises from architectural issues or the sheer size of the site. It is fine to add both sitemaps, but they are not required for every project: the decision depends on how easily visitors and crawlers can find pages without them.
Source: https://www.searchenginejournal.com/ask-an-seo-xml-sitemap-or-html-sitemap-betterfor-seo/561650/
Discussion
Sign in or create an account, to join the discussion.