facing an issue with my website sitemap

#1104774
  • Resolved yosef ahmad
    Rank Math free

    Hello, I am facing an issue with my website sitemap. Before September 9, my old website had around 540 posts, but in the new website I only have 260 posts. However, the sitemap (post-sitemap.xml) is still showing 540 posts from the old site instead of the current number. I already generated a new sitemap using Rank Math, but it is not updating correctly and continues to display the old posts. Can you please help me fix this issue so that the sitemap reflects the correct number of posts from m

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

    We apologize for the issue you are facing with your website’s sitemap. It sounds like there may be a caching issue or a problem with how the sitemap is being generated. Here are a few steps you can take to troubleshoot and potentially resolve this issue:

    1. Flush Permalinks: Sometimes, simply flushing the permalinks can help. Go to your WordPress admin area, navigate to Settings → Permalinks, and click the Save Changes button without making any changes. This can refresh the sitemap generation process.
      Flush permalink settings

    2. Clear Cache: If you have any caching plugins installed, clear the cache. Caching can sometimes cause old data to be displayed.

      • You can also check if your server has caching enabled and clear that as well.
    3. Check Sitemap Settings: Ensure that all your posts are set to be included in the sitemap. Go to Rank Math SEO → Sitemap Settings and verify that the settings are correct for your posts.

    4. Disable Other Plugins: There might be a conflict with another plugin. You can try disabling other plugins temporarily to see if that resolves the issue.

    5. Check for Custom Canonicals: If you have set custom canonical URLs for your posts, they may not appear in the sitemap. Make sure to remove any custom canonicals if you want all posts to be included.

    If these steps do not resolve the issue, please reply to this ticket with your website URL so we can assist you further. A human agent from our support team will take over and provide more specific guidance based on your site’s configuration.

    Thank you for raising this concern, and we look forward to helping you resolve it!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

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

    Also, head over to your website files /uploads/rankmath/, and delete any XML files from that path.

    Looking forward to helping you.

    Hello,

    Thank you for your support. The issue has been resolved.
    The solution that worked for me was Method #3: disabling the sitemap caching by applying this filter:

    /**
    * 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’);

    After adding this code, my XML Sitemap now always reflects the latest changes on my site.

    Thanks again for your help!

    Hello,

    Glad that everything has been sorted out.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

You must be logged in to reply to this ticket.