<b>SOP: Validate XML before you ever submit</b>
Google parses strictly. One unescaped ampersand and parsing stops at that line. Pre-flight:
— ✅ File is well-formed XML — <code>xmllint --noout sitemap.xml</code> exits 0
— ✅ Ampersands in URLs escaped as <code>&amp;</code>, not raw <code>&</code>
— ✅ Single quotes/angle brackets escaped (<code>&apos;</code>, <code>&lt;</code>)
— ✅ UTF-8 encoded, no BOM (a leading BOM breaks the XML declaration)
— ✅ Correct namespace: <code>xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"</code>
The BOM bug is invisible in most editors — the file looks perfect, Google reports "not valid XML" at line 1.
Command: <code>file sitemap.xml</code> — must NOT say "with BOM".
Definition of done: xmllint passes and <code>file</code> reports plain UTF-8.
The Sitemap SOP
@SitemapSOP
<b>SOP: Validate XML before you ever submit</b>
Этот пост опубликован в Telegram-канале The Sitemap SOP. Подписаться можно по ссылке: @SitemapSOP.