MJ theme: Version 8.9.1
YOAST plugin: Version 3.4.1
I have been unable to generate the site map file for my site. I googled around, and found a lot of forums where people are saying the issue is that a blank is being inserted somewhere by either the theme or a plugin. I turned off all the plugins, and still get the error. So there must be something wrong in the theme. I checked the functions.php looking for any spaces and eliminated all I found. Still, the issue persists.
Has anyone had this issue?
BELOW YOU CAN SEE THE LINK TO THE SITEMAP FILE, and the error.
This page contains the following errors:
error on line 2 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
I just did a quick test and version 8.9 and 8.9.3 work fine with YOAST and generate a site map easily. It must be the beta 8.9.1 has an blank somewhere in the theme.
Please insert the following code in .htaccess file, this will fix the issue
# Yoast SEO – XML Sitemap Rewrite Fix
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END Yoast SEO – XML Sitemap Rewrite Fix
If you want the latest updated plugin V3.4.0 of yoast you can download it from here :
I discovered finally what was the problem. My site is in Spanish, and in the language file, I had two blank spaces after the closing php statement. This breaks YOAST’s sitemap function. I deleted the blank lines, and it works. So probably the beta 8.9.1 had no issues, it was my bad language file.
I have tried adding that code to my .htaccess file, disabling all my plugins and Yoast still does not list any single listing pages. I am having to manually add/remove a sitemap. Very frustrating. Has anyone else had this issue?
You must be logged in to reply to this topic.