Getting error on sitemap

#729302
  • Resolved Anonymous
    Rank Math free

    Sitemap

    for some reason we are getting this error on our sitemap:

    This page contains the following errors:
    error on line 6 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 am not sure on where on wp-config or functions.php should I look. I know that it could be due to extraspace but not where to look for that.

Viewing 1 replies (of 1 total)
  • Hello,

    I’m sorry to hear that you’re encountering an error on your sitemap. The error message you’re seeing indicates that there might be an issue with the XML declaration in your sitemap file.

    To address this issue, you can start by checking for any extra spaces or lines in your wp-config.php or functions.php files. If you don’t find any extra spaces in those files, you can also use the Health Check plugin to check for conflicts with other plugins.

    If you’re still unable to resolve the issue, you can add a filter to your theme’s functions.php file to disable caching for the sitemap. Here’s the code you can add:

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    After adding the filter, make sure to clear your website cache and then check the sitemap again.

    If you need further assistance or have any other questions, please feel free to reach out to our support team directly from here, and we’ll be happy to help.

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    Remove Blank Lines From Sitemaps » Rank Math
    How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Getting error on sitemap’ is closed to new replies.