Sitemap pages returning 404 after adding exclusions

#845509
  • Resolved Jecca Arthur
    Rank Math free

    I have 5 sitemap pages for a particular post type (/sample-plan-page-sitemap1.xml, /sample-plan-page-sitemap2.xml, /sample-plan-page-sitemap3.xml, etc.). I’ve excluded a large number of this post type from the sitemap using post IDs.

    After saving my changes, 3 of the 5 sitemap pages return 404s, instead of the remaining included posts being consolidated into 1-2 sitemap pages.

    Please let me know how this can be resolved.

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

    We apologize for the issue you are facing with your sitemap pages returning 404 errors after adding exclusions. This can happen if the sitemap is not properly updated or if there are caching issues.

    Here are a few steps you can take to resolve this:

    1. Clear Cache: If you are using any caching plugins, make sure to clear the cache. Sometimes, cached versions of the sitemap can lead to 404 errors.

    2. Exclude Sitemap from Caching: Ensure that your sitemap is excluded from being cached. You can follow our guide on how to exclude sitemaps from caching.

    3. Check Sitemap Settings: Double-check your sitemap settings in Rank Math to ensure that the post type is correctly configured and that the exclusions are set as intended. You can navigate to WordPress Dashboard → Rank Math SEO → Sitemap Settings and review the settings for your post type.

    4. Re-save Permalinks: Sometimes, simply re-saving your permalinks can help resolve 404 errors. Go to Settings → Permalinks and click Save Changes without making any changes.

    5. Check for Conflicts: If you have security plugins or server-level restrictions, they might be blocking access to the sitemap. Ensure that there are no restrictions in place that could affect the sitemap’s accessibility.

    If these steps do not resolve the issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern, and we hope to get this resolved for you soon!

    Sources:
    How to Exclude Content From Sitemap » Rank Math
    How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math
    How To Exclude Rank Math Sitemaps from Caching » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Could you please try to follow the steps below and see if that works for you?

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    3. If the above steps don’t seem to work, kindly apply the following filter to your site.

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

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hi Adetayo,

    I’ve followed these steps but am still experiencing the same issue.

    I’ve confirmed that I’m seeing the sitemap update for various things, like excluding a certain post type as a whole, or excluding individual posts. These behave as expected, but when I exclude a large number of post IDs resulting in a sitemap page’s full collection of posts being excluded, that page still returns a 404.

    Thanks,
    Jecca

    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 logins in the designated Sensitive Data section.

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

    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,

    To investigate this issue further, we might need to take a closer look at your website and settings. Please follow these steps:

    • Edit the first post on this ticket and include your WordPress and FTP logins in the Sensitive Data section. This is a secure section that only our support staff can access.
      Sensitive Data Section
    • Make sure you take a complete backup of your website before sharing the information with us.
    • If you prefer, you can use this 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 also use this plugin to monitor what changes our staff might make on your website (if any): https://wordpress.org/plugins/wp-security-audit-log/

    We appreciate your cooperation and patience.

    Thank you for choosing Rank Math.

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

The ticket ‘Sitemap pages returning 404 after adding exclusions’ is closed to new replies.