No sitemap link in the page head
What is this issue?
This issue checks whether your web pages include a <link rel="sitemap"> tag in the HTML head section that points to your XML sitemap location.
A passing implementation includes a link tag in the <head> section that explicitly declares the location of your XML sitemap:
Example of correct implementation:
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />This tag helps search engines and other crawlers discover your sitemap directly from the HTML source, providing an additional method of sitemap discovery beyond the traditional /sitemap.xml URL and the Sitemap: directive in robots.txt.
Where it is reported
The tag is optional, and PixyScan treats it that way. Two different states are reported, and they are reported in different places:
- A tag that cannot work — no
href, an emptyhref, or a value that is not a fetchable address — is reported on any page that declares it. The page has published a pointer that points at nothing. - No tag at all is reported on the homepage only. Where a site declares its sitemap is one decision, not one per URL, so it produces one row per scan.
The type attribute is not judged. application/xml, text/xml and an omitted
type are all valid.
Why it matters
Including a <link rel="sitemap"> tag in your HTML head provides several SEO benefits:
Enhanced discoverability: While most search engines check for
/sitemap.xmlautomatically, the link tag provides an explicit signal about your sitemap location, ensuring it's found even if standard methods fail.Crawler efficiency: Some crawlers and SEO tools check the HTML head for sitemap references, which can speed up the discovery process.
Multiple discovery paths: Having your sitemap discoverable through multiple methods (direct URL, robots.txt, and HTML head) creates redundancy and increases the likelihood that all search engines will find it.
Comprehensive SEO: This is a relatively simple addition that demonstrates attention to technical SEO detail, contributing to a well-optimized website.
While this is not a critical issue (search engines will typically find your sitemap through other methods), implementing it shows technical SEO maturity and can help ensure complete indexation of your site.
Resolving this issue improves your SEO health score by demonstrating comprehensive technical optimization and providing additional pathways for search engines to discover your content.
How to fix it
Follow these steps to add the sitemap link tag to your HTML:
Identify your sitemap URL: Determine the correct path to your XML sitemap (typically
/sitemap.xmlor/sitemap_index.xml).Add the link tag to your HTML head: Place the following line inside the
<head>section of your HTML document:<link rel="sitemap" type="application/xml" href="/sitemap.xml" />Adjust the href value if needed: If your sitemap is located at a different path, update the
hrefattribute accordingly:<link rel="sitemap" type="application/xml" href="/path/to/your/sitemap.xml" />For multiple sitemaps: If you have multiple sitemaps, you can include multiple link tags:
<link rel="sitemap" type="application/xml" href="/sitemap-pages.xml" /> <link rel="sitemap" type="application/xml" href="/sitemap-images.xml" />Verify implementation: Use View Page Source or browser developer tools to confirm the tag appears correctly in the rendered HTML.
Note: This tag should be present on all pages of your website for consistency, though it's most important on the homepage.
Examples
Example 1: Correct Implementation
Scenario: A properly configured page with sitemap link tag.
Correct State (Passes):
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
<title>Page Title</title>
</head>Example 2: Missing Sitemap Link Tag
Scenario: Page has no sitemap link tag in the head.
Problematic State (Fails):
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Page Title</title>
</head>Why it fails: Search engines and crawlers won't discover the sitemap through this HTML discovery method.
Corrected State (Passes):
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
<title>Page Title</title>
</head>Example 3: Multiple Sitemaps
Scenario: Site has multiple sitemaps for different content types.
Correct State (Passes):
<head>
<link rel="sitemap" type="application/xml" href="/sitemap-pages.xml" />
<link rel="sitemap" type="application/xml" href="/sitemap-images.xml" />
<link rel="sitemap" type="application/xml" href="/sitemap-videos.xml" />
<title>Page Title</title>
</head>Example 4: Sitemap at Non-Standard Location
Scenario: Sitemap is located at a non-standard path.
Correct State (Passes):
<head>
<link rel="sitemap" type="application/xml" href="/feeds/sitemap.xml" />
<title>Page Title</title>
</head>Note: The href attribute should point to the actual location of your sitemap file.
Example 5: Sitemap Link on Homepage
Scenario: Sitemap link is most important on the homepage.
Correct State (Passes):
<!-- Homepage (https://example.com/) -->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
<title>Home - Example Site</title>
</head>Note: While it's best to include the sitemap link on all pages, it's most critical on the homepage since that's often the first page crawled.
How PixyScan detects this
This check is scoped, and the scope is the most important thing about it.
An earlier version reported "no <link rel="sitemap"> in the head" on every page of
every site. Most well-optimised sites deliberately omit the tag — search engines
discover sitemaps from the Sitemap: directive in robots.txt (issue #14) or from a
manual submission in Search Console — so that version produced a finding on nearly
every page it looked at, over a single site-wide decision. It also demanded
type="application/xml" exactly, which reported the equally valid text/xml and an
omitted type as wrong on the minority of sites using the tag correctly.
What PixyScan checks now:
Link tag search — every
<link>whoserelattribute contains the tokensitemap. Therelattribute is a space-separated token list, sorel="sitemap alternate"is read as well asrel="sitemap", and the value is matched case-insensitively.href resolution — the
hrefis resolved against the page's own URL, sohref="/sitemap.xml"becomes the absolute address a crawler would fetch. A value that cannot resolve to anhttp(s)address is unusable: an absenthref, an empty one, ajavascript:ormailto:value, or a bare#fragment that points back at the current page.Reported on every page — a
<link rel="sitemap">that IS declared and cannot work. A page that declared the tag has asked for it to be read, and inert markup is inert wherever it sits.Reported on the homepage only — no
<link rel="sitemap">at all. Declaring the sitemap in the head is a site-wide decision, so it produces one row per scan rather than one per crawled URL. This is the same shape issues #34 and #35 use for the other declarations a site makes once.Not checked at all — the
typeattribute.application/xml,text/xmland an omittedtypeare all correct.
The check does not fetch the address in the href; whether the sitemap file itself
exists and parses is issue #4's question.
What we store
Storage Level
Page Level — This issue is evaluated for each individual URL.
Database Table / Prisma Model
PageHtmlHeadAudit
Stored Fields
| Field | Type | Description |
|---|---|---|
| sitemapLinkUrl | String? | The URL found in the sitemap link tag |
Detection Dependencies
- The following data sources are required to evaluate this issue:
- HTML Document — The crawler parses the HTML head section to find the sitemap link tag
- Link Tag Extraction — The
<link rel="sitemap">tag is extracted