Languages

Sitemap - xml content exception (error on line 1 at column 126: Extra content at the end of the document)

7 points
Asked by:
Jacob
532

I have created XML sitemap for my website.

After the first link appeard I have got the following error:

This page contains the following errors:
error on line 1 at column 126: Extra content at the end of the document
Below is a rendering of the page up to the first error.

Any idea what is the error reasone?

1 answer
3 points
Answered by:
Jacob
532

Check, if you have <?xml> element and wrapping <urlset> HTML tags in your sitemap.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://my-site/auctions/antique+table</loc>
    <lastmod>2021-10-10T22:50:41+02:00</lastmod>
  </url>
  <!-- More <url></url> elements here ... -->
</urlset>

 

It looks like your sitemap looks this way:

<url>
  <loc>http://my-site/auctions/antique+table</loc>
  <lastmod>2021-10-10T22:50:41+02:00</lastmod>
</url>
<url>
  <loc>http://my-site/auctions/another+item+1</loc>
  <lastmod>2021-10-10T22:50:41+02:00</lastmod>
</url>
<url>
  <loc>http://my-site/auctions/another+item+2</loc>
  <lastmod>2021-10-10T22:50:41+02:00</lastmod>
</url>
<url>
  <loc>http://my-site/auctions/another+item+3</loc>
  <lastmod>2021-10-10T22:50:41+02:00</lastmod>
</url>

And, It shoud be looking this way:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://my-site/auctions/antique+table</loc>
    <lastmod>2021-10-10T22:50:41+02:00</lastmod>
  </url>
  <url>
    <loc>http://my-site/auctions/another+item+1</loc>
    <lastmod>2021-10-10T22:50:41+02:00</lastmod>
  </url>
  <url>
    <loc>http://my-site/auctions/another+item+2</loc>
    <lastmod>2021-10-10T22:50:41+02:00</lastmod>
  </url>
  <url>
    <loc>http://my-site/auctions/another+item+3</loc>
    <lastmod>2021-10-10T22:50:41+02:00</lastmod>
  </url>
</urlset>

 

0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join