Google parses strictly. One unescaped ampersand and parsing stops at that line. Pre-flight:
— ✅ File is well-formed XML — xmllint --noout sitemap.xml exits 0
— ✅ Ampersands in URLs escaped as &, not raw &
— ✅ Single quotes/angle brackets escaped (', <)
— ✅ UTF-8 encoded, no BOM (a leading BOM breaks the XML declaration)
— ✅ Correct namespace: xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
The BOM bug is invisible in most editors — the file looks perfect, Google reports "not valid XML" at line 1.
Command: file sitemap.xml — must NOT say "with BOM".
Definition of done: xmllint passes and file reports plain UTF-8.
The Sitemap SOP
@SitemapSOP
SOP: Validate XML before you ever submit
This post was published in the Telegram channel The Sitemap SOP (@SitemapSOP). All its posts are on the channel page.
Open on Telegram