Problem generating the sitemap file using YOAST SEO plugin


  • Raul
    Newbie
     
    24 points

    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?
    https://wordpress.org/support/topic/yoast-seo-xml-sitemap-error

    BELOW YOU CAN SEE THE LINK TO THE SITEMAP FILE, and the error.
    http://www.chiveando.com/sitemap_index.xml

    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.



    Raul
    Newbie
     
    24 points

    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.


    Hanif
    Hanif
    Newbie
     
    14 points

    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


    Hanif
    Hanif
    Newbie
     
    14 points

    If you want the latest updated plugin V3.4.0 of yoast you can download it from here :

    Yoast SEO Premium v3.4.0 – WordPress Seo Plugin Nulled



    Raul
    Newbie
     
    24 points

    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.



    Becca
    Newbie
     
    34 points

    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?


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.