Notifications
Clear all

[Solved] Sitemap.xml show an error "error on line 2 at column 6: XML declaration allowed only at the start of the document."

5 Posts
2 Users
1 Reactions
1,869 Views
Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago
Topic Tags
4 Replies
Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

Opeing the source, i see the page has been "optimized" by W3 total cache. I am going to exclude it, and report here.

Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

Actually, I don't think Total cache is guilty here. Here is the source:

 
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//lebearcnc.com/wp-content/plugins/wpforo/assets/css/wpforo-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc> https://lebearcnc.com/forums/topic-sitemap1.xml</loc> 
	</sitemap>
	<sitemap>
		<loc> https://lebearcnc.com/forums/topic-sitemap2.xml</loc> 
	</sitemap>
	<sitemap>
		<loc> https://lebearcnc.com/forums/profile-sitemap1.xml</loc> 
	</sitemap>
	<sitemap>
		<loc> https://lebearcnc.com/forums/profile-sitemap2.xml</loc> 
	</sitemap>
	<sitemap>
		<loc> https://lebearcnc.com/forums/profile-sitemap3.xml</loc> 
	</sitemap>
	<sitemap>
		<loc> https://lebearcnc.com/forums/forum-sitemap.xml</loc> 
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by wpForo SEO -->
<!--
Performance optimized by W3 Total Cache. Learn more:  https://www.boldgrid.com/w3-total-cache/ 

Mise en cache objet de 0/74 objets utilisant redis
Mise en cache de page à l’aide de redis (Requested URI is rejected) 
Chargement lent
Mise en cache de la base de données utilisant redis  (Request-wide modification query)

Served from: lebearcnc.com @ 2023-03-31 13:34:22 by W3 Total Cache
-->

Should not this line be the first ?

<!-- XML Sitemap generated by wpForo SEO -->

If you confirm, and tell me where this is generated, I guess I can fix this.

Thnaks for your help.

Chris
Posts: 3627
(@chris)
Famed Member
Joined: 3 years ago

Hi @le-bear,

We have checked the URL, as it is in the Screenshot you provided, and the page works.

Just note if you have done any manipulations, please bring them back to default(not to get any problems).

Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

Yes, thank you, I found the guilty plugin in between...