Pretty_Girl3
Pretty_Girl3

Reputation: 41

What's wrong with this xml site map? gives errors when I submit to google

I wanted to submit following xml file to the google search console. But, when I submit, it gives the error "Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead."

When I directly view the xml file on browser (www.example.com/sitemap.xml) .. then it says, "XML Parsing Error: not well-formed Location: http://www.example.com/sitemap.xml Line Number 6, Column 79: <loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=1&Itemid=101</loc> ------------------------------------------------------------------------------^

But, I don't see any formatting errors, I can't figureout what is the error.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" 
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">

  <url> 
    <loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=1&Itemid=101</loc> 
    <image:image>
       <image:loc>http://www.example.com/images/logo.png</image:loc>
       <image:caption>EXAMPLE SITE</image:caption>
    </image:image>


<loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=2&Itemid=134</loc> 

<loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=5&Itemid=107</loc> 

<loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=7&Itemid=106</loc> 

<loc>http://www.example.com/index.php?option=com_content&view=category&layout=blog&id=8&Itemid=108</loc> 

<loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=6&Itemid=118</loc> 

<loc>http://www.example.com/index.php?option=com_sppagebuilder&view=page&id=4&Itemid=111</loc>   


  </url>
</urlset>

Upvotes: 0

Views: 1210

Answers (1)

Pretty_Girl3
Pretty_Girl3

Reputation: 41

I got this solved by my self :)

There shouldn't be any & in the URLs. If it contains any, it should be replaced with &amp;

and there should be <url> </url> per each loc tag.

Hope this helps to some other person.

The corrected and functioning code as follows

    <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" 
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url> 
    <loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;view=page&amp;id=1&amp;Itemid=101</loc> 
    <image:image>
       <image:loc>http://www.example.com/images/logo.png</image:loc>
       <image:caption>EXAMPLE SITE</image:caption>
    </image:image>
     </url>
 <url> 

<loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;amp;view=page&amp;amp;id=2&amp;Itemid=134</loc> 
 </url>
 <url> 
<loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;amp;view=page&amp;amp;id=5&amp;Itemid=107</loc> 
</url>
 <url> 
<loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;amp;view=page&amp;amp;id=7&amp;Itemid=106</loc> 
</url>
 <url> 
<loc>http://www.example.com/index.php?option=com_content&amp;amp;view=category&amp;amp;layout=blog&amp;id=8&amp;Itemid=108</loc> 
</url>
 <url> 
<loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;amp;view=page&amp;amp;id=6&amp;Itemid=118</loc> 
</url>
 <url> 
<loc>http://www.example.com/index.php?option=com_sppagebuilder&amp;amp;view=page&amp;amp;id=4&amp;Itemid=111</loc>   


  </url>
</urlset>

Upvotes: 2

Related Questions