webzod
account

Fix the sitemap format

hygiene.sitemap.invalid · effort: about an hour

Why it matters

The sitemap file cannot be read as a valid sitemap, so search engines will ignore it. The usual causes are an html page returned instead of the file, broken xml, or a wrong encoding.

The fix

  1. Open the sitemap and check it is xml and not an html page. If it is html, a catch-all rewrite or a login or error page is answering instead of the file.
  2. Check the xml is well formed, saved as UTF-8, with the sitemaps.org namespace, absolute URLs, and special characters escaped (an & in a URL must be written as &). Validate it with an xml validator or Google Search Console.
  3. Regenerate the file from your CMS or generator if it is built automatically, and make sure plugins print nothing before the xml declaration.
text
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/page?a=1&amp;b=2</loc>
  </url>
</urlset>

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.