404 pages appearing in the XML sitemaps

#971116
  • I have a problem. There are non-existing pages under the /definitive-guide/ directory (in the XML sitemaps) that are returning a 404 status. We changed the base URL for these posts, so the sitemaps should only include the live URLs (these URLs don’t have internal links, but they will show up in GSC, and the client may ask about them). Any page that is drafted should be automatically removed from the XML sitemaps (which is the default setting), but I’m still seeing some of them appear.

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

    We apologize for the issue you are facing with the 404 pages appearing in your XML sitemaps. It seems that even after changing the base URL and ensuring that drafted pages should not appear, some non-existing pages are still being listed.

    Here are a few steps you can take to address this issue:

    1. Check for Cached Sitemaps: Sometimes, cached versions of your sitemap may still show old URLs. Make sure to clear any cache on your site and regenerate the sitemap. You can do this by going to Rank Math SEO → Sitemap Settings and clicking on the option to regenerate the sitemap.

    2. Verify Draft Settings: Ensure that the settings for excluding drafts from the sitemap are correctly configured. You can check this under Rank Math SEO → General Settings → Sitemap and confirm that the option to exclude drafts is enabled.

    3. Inspect Robots.txt: Make sure there are no rules in your robots.txt file that might be affecting how URLs are indexed or displayed in the sitemap. You can check this by going to Rank Math SEO → General Settings → robots.txt.

    4. Manual Removal: If certain URLs continue to appear, you may need to manually remove them from the sitemap or set up 301 redirects to guide users to the correct pages.

    5. Check for Plugin Conflicts: Sometimes, other plugins can interfere with how Rank Math generates sitemaps. You can use the Health Check plugin to identify any potential conflicts.

    If these steps do not resolve the issue, please reply to this ticket with your site URL so that a human agent from our support team can assist you further.

    Thank you for raising this concern, and we hope to help you resolve it soon!

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    I’ve tried clear cache from WP rocket and change htacess but it doesn’t work. I don’t know the correct reason. I’m disappointing about rank math. I’ve wait your response for more 2 hours.

    Hello,

    Could you please share the affected sitemap URL so we can check as well? You can add it to the sensitive data section by editing your first post

    Sensitive Data Section

    It is completely secure, and only our support staff has access to that section.

    Meanwhile, please note that the sitemap will not remove redirected URLs that are still available in the WordPress backend.

    You can either delete/unpublish/draft those pages, or set them to noindex and they will be removed from the sitemap completely.

    Also, please follow these steps to flush your sitemap cache:

    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. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:

    /** 
     * Filter if XML sitemap transient cache is enabled.
     *
     * @param boolean $unsigned Enable cache or not, defaults to true
     */
    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Looking forward to helping you.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.