• Resolved aheli

    (@aheli)


    Hi,
    My sitemap was suddenly broken yesterday as you can see in the link I sent. I can see 2 reasons :
    – I have installed the last Yoast SEO release yesterday
    – I have installed Wordfence plugin (may be incompatibility ?)
    Thanks for help,
    Aheli

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @aheli,

    Thanks for reaching out.

    The XML sitemap index at https://lanteas.com/sitemap_index.xml is not loading as expected. However, the source of the sitemap is generated as expected. As long as the source is generated correctly, this is not an issue for the search engines. They do not use the stylesheet on the sitemaps; the stylesheet is only used so that the XML Sitemaps are also presented in a human-friendly format. Did you get any errors in Google Search Console after submitting the sitemap?

    The issue is usually caused by caching and minifying plugins. Kindly ensure to exclude the sitemap index from being cached. Does this fix your issue?

    We are looking forward to your reply.

    Thread Starter aheli

    (@aheli)

    Hi,Thanks for your response.
    In fact I don’t use any cache plugin.
    I tried to disable all plugins and I have still the issue.
    You say that “As long as the source is generated correctly, this is not an issue for the search engines” but I do have a google search engine issue with this sitemap.
    Error message is “your sitemap cannot be read, bad format”.
    It was correct 2 days ago.
    Any other idea ?

    Sa?a

    (@stodorovic)

    I see ?> at the begin (check view HTML source). It looks as issue with prepend PHP script. Try to deactivate Wordfence plugin at the moment to check is it working correctly.

    Thread Starter aheli

    (@aheli)

    As I said previously, I tried to deactivate all plugin but SEO, including Wordfence, and the issue is still remaining.
    Anyway is there a way to modify the xml file after it is generated ? Where is it located ?
    Thanks for help.

    Sa?a

    (@stodorovic)

    Yoast SEO generates sitemaps “on the fly”. So, you can’t edit it on this way.

    Also, it doesn’t affect only sitemaps. It breaks HTML. Check your home page on https://validator.w3.org/ You will see:

    Non-space characters found without seeing a doctype first. Expected <!DOCTYPE html>.

    From line 1, column 1; to line 1, column 2

    I’d guessing that’s trouble with php prepend script which Wordfence adds (check php.ini). Try to remove prepend script or deactivate Wordfence. Then please clear all caches and check. There are probably double closing tags. Something like this:

    ?>
    ?>
    
    Sa?a

    (@stodorovic)

    If you didn’t edit any PHP file then please check auto_prepend_file (you could run phpinfo). It should point to wordfence-waf.php in WP root directory. Check this file. Check wp-config.php.

    Thread Starter aheli

    (@aheli)

    You are right : in the public_html folder I see a .user.ini file who contains :

    ; Wordfence WAF
    auto_prepend_file = '/home/lanteas/public_html/wordpress/wordfence-waf.php'
    ; END Wordfence WAF

    Do I need to remove this file ?
    And if yes, will wordfence still work ?

    Sa?a

    (@stodorovic)

    It runs WAF before WP code. So, Wordfence will be limited (if you remvoe the file).

    Somewhere in any PHP file (theme, plugins, WP core, prepend files, wp-config.php) is double closing tag. You need to identify it and remove. Did you change any PHP file in last days?

    Based on your comment – it’s possible that WP is in separate directory. So, you have index.php in public_html which send ‘?>’. Index.php in public_html/wordpress seems correct. Please check files in public_html and .htaccess.

    Thread Starter aheli

    (@aheli)

    Sorry Sasa, and congratulations !
    The problem was in the index.php file in public_html.
    Thanks a lot for your very efficient help ??

    Thread Starter aheli

    (@aheli)

    So I close the ticket

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Sitemap broken’ is closed to new replies.