Bug? page-sitemap.xml and post-sitemap.xml Contain Invalid Self-Referencing URLs

#1053952
  • Resolved Kevin Woolley
    Rank Math free

    Hi,

    Both my page-sitemap.xml and post-sitemap.xml files contain invalid entries that are causing Google Search Console to flag errors. Specifically, each includes a <loc> pointing to the sitemap file itself:

    xml
    Copy
    Edit
    <loc>/page-sitemap.xml</loc>
    <loc>/post-sitemap.xml</loc>
    These relative URLs are invalid in sitemap content and refer to the sitemap files themselves, not to any actual post or page. This leads to “Invalid URL” errors in Search Console.

    Key facts:

    – There are no posts or pages with the slugs page-sitemap or post-sitemap (including draft or trash).
    – This happens both on my production and development sites.

    I have:

    – Cleared all caches (RankMath, WP Rocket, hosting layer)
    – Flushed permalinks
    – Used RankMath’s database tools to clear transients
    – Toggled sitemap settings on/off
    – Deactivated and reactivated the plugin

    The sitemap index (sitemap_index.xml) is valid and correctly references the component sitemaps. The issue is inside the component sitemaps themselves.

    This appears to be a bug — possibly a ghost entry or an issue with how RankMath generates sitemap contents. Please advise how to resolve this or if it’s a known problem.

    Thank you

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

    We apologize for the issue you are facing with the invalid self-referencing URLs in your page-sitemap.xml and post-sitemap.xml files. Thank you for providing detailed information about the steps you’ve already taken to troubleshoot this issue.

    This situation can occur due to a few reasons, and here are some steps you can take to resolve it:

    1. Check for Custom Canonicals: Ensure that there are no custom canonical URLs set for your pages or posts that might be affecting the sitemap generation. If custom canonicals are present, they can lead to unexpected behavior in the sitemap.

    2. Validate Your Sitemap: Use the Validate XML Sitemap tool to check if there are any other issues with your sitemap configuration.

    3. Review Robots.txt: Make sure that your robots.txt file is not blocking access to any of the URLs that should be included in the sitemap. You can check this in Rank Math SEO → General Settings → robots.txt.

    4. Check for Plugin Conflicts: Since you’ve already deactivated and reactivated Rank Math, consider using the Health Check plugin to identify any potential conflicts with other plugins or themes.

    5. Flush Caches Again: After making any changes, ensure that you clear all caches again, including any server-side caching that might be in place.

    If these steps do not resolve the issue, it may indeed be a bug or a deeper issue with how Rank Math generates the sitemaps. In that case, we recommend replying to this ticket so a human agent from the Rank Math Support team can take over and provide further assistance.

    Please include your site URL in your reply if possible, as it will help us investigate the issue more effectively.

    Thank you for your patience, and we look forward to resolving this for you!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math

    Hi,

    Thanks for the response. I’ve already performed the steps you suggested:

    Custom canonicals: None are set for any posts or pages, including those that appear in the sitemap.

    XML validation: I’ve used multiple tools. The sitemap_index.xml is valid, but both page-sitemap.xml and post-sitemap.xml contain invalid self-referencing <loc> entries that are breaking Google Search Console indexing.

    robots.txt: Confirmed there are no disallowed entries affecting the sitemap.

    Plugin conflicts: I’ve tested with Health Check and no conflicting plugins were identified.

    Cache: All caches (plugin, server, Cloudflare) were cleared after each change, and I’ve also tried toggling RankMath’s sitemap features off and back on.

    To reiterate the core issue:
    Inside both page-sitemap.xml and post-sitemap.xml, RankMath is generating invalid <loc> entries like:

    bash
    Copy
    Edit
    <loc>/page-sitemap.xml</loc>
    <loc>/post-sitemap.xml</loc>
    These are not valid page or post URLs. They are links to the sitemap files themselves and should only appear inside the sitemap_index.xml. This is causing Search Console to throw “Invalid URL” errors.

    This occurs both in production and development, with no matching slugs, custom canonicals, or relevant post/page IDs.

    Please escalate to a human support agent. I’m happy to provide login or system info if needed — or even export plugin config if that speeds things up.

    Hello,

    In this case, 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.

    Please do take a complete backup of your website before sharing the information with us.

    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.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    When we attempt to access your staging site, we get the following returned: “The webpage at https://blueripple1dev.wpenginepowered.com/ might be temporarily down or it may have moved permanently to a new web address.
    ERR_TOO_MANY_RETRIES”

    Please review this issue and let us know when the staging site is now accessible so we can proceed with investigating the issue.

    We look forward to hearing back from you.

    Thank you.

    Hi,

    I’ve just tested the admin and frontend URLs in multiple browsers, and they’re loading normally on my end. I haven’t seen the error you’re encountering (ERR_TOO_MANY_RETRIES) before.

    It’s possible this is related to Cloudflare’s DDoS protection, regional IP throttling, or a temporary network routing issue. If you’re accessing the site from outside the U.S. (e.g. India), that could be a factor.

    Can you try accessing the URLs from a different connection or network — or let me know the IP address you’re connecting from, and I can check Cloudflare settings on my end?

    Let me know what you find.

    Best,
    Kevin

    Hello,

    Please note that our team is distributed around the world, and we use dynamic IPs, so even if you whitelist one particular IP now, when we get back to the ticket, our IP might already have changed, so we may never still be able to access the site.

    If you are using geo-blocking, please temporarily unblock the country Portugal, India, Bangladesh, Nigeria, and the Philippines so any of the available support staff here at Rank Math can easily access your website to debug the issue.

    We are looking forward to helping you.

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

The ticket ‘Bug? page-sitemap.xml and post-sitemap.xml Contain Invalid Self-Referencing URLs’ is closed to new replies.