sitemap error

#152311
  • Resolved Andrea Devito
    Rank Math free

    Can you help me? I got this error:

    This page contains the following errors:
    error on line 3 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.

    with ctrl+u I read the origin
    BUT I do not find in httpdocs the file containing this:
    <?xml version=”1.0″ encoding=”UTF-8″?><?xml-stylesheet type=”text/xsl” href=”//adv.eu/main-sitemap.xsl”?>
    <sitemapindex xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″&gt;
    <sitemap>
    <loc>https://adv.eu/page-sitemap.xml</loc&gt;
    <lastmod>2021-02-17T00:59:25+01:00</lastmod>
    </sitemap>
    <sitemap>
    <loc>https://adv.eu/wpdmpro-sitemap.xml</loc&gt;
    <lastmod>2020-08-06T09:30:38+02:00</lastmod>
    </sitemap>
    </sitemapindex>
    <!– XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math – rankmath.com –>

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    I’ve checked your sitemap, and it is indeed having some white spaces before the codes. This might be added by a blank line/space in your wp-config.php file or your theme’s functions.php file. If there is no such blank space in your wp-config.php or functions.php file, please check for a plugin conflict using the Health Check plugin.

    Also, make sure your cache is disabled as it is highly likely that the cache is interfering with the working of Sitemap functionality of Rank Math.

    I hope that helps. Thank you, and looking forward to your update.

    Andrea Devito
    Rank Math free

    Ciao, I checked both and no blank space or lines are there.
    I checked plugin and no problem.
    With yoast I got the sitemap, with rankmath I do not and I am a little bit angry for that.
    Any other suggestion?

    Anas
    Rank Math business

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Andrea Devito
    Rank Math free

    Updated Sensitive Data section.

    Thank you and please let me have a rankmath sitemap!!!! 😁

    Hello,

    Thank you for following up.

    I’ve used the Health Check plugin to find the culprit for this issue, and it seems that it is your theme (Think) that’s generating the white spaces in your sitemap. You can also try it in troubleshooting mode with Rank Math and a default theme only enabled.

    In this case, please get in touch with your theme provider to fix this issue.

    I hope that helps. Thank you, and please don’t hesitate to contact us if you need further assistance.

    Andrea Devito
    Rank Math free

    do you know how to contact think theme creator? I think the company was closed.
    if I use a default theme, can I create a sitemap with rankmath and then come back to think theme?

    Hello,

    Thank you for keeping in touch with us.

    I don’t think it would work that way. It is likely that the theme you are currently using is generating whitespace. Even if you switch themes, it won’t surely work. Please see the screenshot in the sensitive data section.

    Unfortunately, the theme’s website is no longer active to contact the theme authors. If you have other contact information from the theme such as email address, you can directly contact them and ask for a solution.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Andrea Devito
    Rank Math free

    I Will try this code on functions.php to delete lines…hope it will work. Any other ideas?

    add_filter(‘rank_math/sitemap/entry’, function ($url){
    if (isset($url[‘loc’]) && empty($url[‘loc’])) {
    return false;
    } return $url;
    });

    Hello,

    Thank you for the update, and sorry for the delay.

    Unfortunately, we don’t have a filter to remove white spaces being added by your theme. In this case, you can get help from a developer to check your theme since the Author is no longer active, or you can use a 3rd party sitemap plugin to generate your sitemap. Please ensure that the Rank Math sitemap module is disabled in Rank Math > Dashboard.

    If using other sitemap plugins didn’t work, I’m afraid you would need to change your theme for the sitemap to be generated. Using an outdated theme might also cause you trouble in the future.

    I hope that helps. Thank you, and please don’t hesitate to contact us if you need further assistance.

    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 9 replies - 1 through 9 (of 9 total)

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