Sitemap has draft products in it (added it to WP Rocket as Cache exception)

#898972
  • Resolved Hilary Torn
    Rank Math free

    Just what it says. Sitemap has products that have been in draft mode for awhile. I added the site map as an exclusion for WP rocket but this did not help.

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

    We apologize for the issue you are facing with your sitemap including draft products. It seems that even after adding the sitemap as an exclusion in WP Rocket, the draft products are still appearing.

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

    1. Check Sitemap Settings: Ensure that your sitemap settings in Rank Math are configured correctly to exclude draft products. You can do this by navigating to Rank Math SEO → Sitemap Settings and verifying the settings related to post visibility.

    2. Clear Cache: After making changes, make sure to clear the cache in WP Rocket. Sometimes, cached versions may still show outdated information.

    3. Disable Caching for Specific User Agents: If you are using W3 Total Cache alongside WP Rocket, consider creating a user agent group and adding the ‘googlebot’ user agent to it. This can help ensure that Google sees the most up-to-date version of your sitemap.

    4. Use a Filter: If the above steps do not resolve the issue, you can add the following filter to your theme’s rank-math.php file to disable caching for the sitemap:

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

      This will ensure that your sitemap is always generated fresh without caching.

    5. Check for Plugin Conflicts: Sometimes, other plugins may interfere with how Rank Math generates the sitemap. 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, and a human agent from the Rank Math Support team will assist you further. Thank you for raising this concern!

    Hilary Torn
    Rank Math free

    4. Use a filter doesn’t work. I’ve disabled WP rocket and clearned Varnish cache and added the sitemap to a varnish exception and it still shows up. I can’t test it on staging because when i copy to staging, the issue is gone. I’m not deactivating all plugins to test this, it will break our live site.

    Please help me fix this issue. I’ve had a lot of problems with Rank Math, another with another client, and on a 3rd client I’ve used Yoast no problem.

    Hilary Torn
    Rank Math free

    Just to be clear, Use a filter is not clear and causes an error when I try to implement this. The instrucctions are not clear.

    Hello,

    You should add the code to your theme or child theme’s functions.php file or use a plugin.

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

    Also, 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/

    Looking forward to helping you.

    Hilary Torn
    Rank Math free

    Its excluded from WP rocket and when I turn WP rocket off completely the issue is still there.

    Your auto reply says rank-math.php, you should update that if it is not correct, its confusing.

    Hello,

    The filter can be added with one of the following options: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    After adding the filter please remove the XML files from wp-content/uploads/rank-math and test the sitemap once again.

    Thank you.

    I didn’t have to remove the files to get it to work. It works, but had tons not in site map. Its disappointing RankMath doesn’t work well out of the box 🙁

    Hello,

    We apologize for the inconvenience. The issue seemed related to the sitemap cache.

    It looks like you marked this ticket as resolved, but if the issue is not resolved, please let us know if you have added the filter or if you’d prefer we log in to your site to troubleshoot the issue ourselves.

    We are looking forward to hearing back from you.

    No I got it working. Had draft files in site map and 12 URLs were not in the site map.

    All good now just really sad it was broken for so long.

    Hello,

    Thank you for letting us know that it’s now working, and we’re truly sorry to hear about the challenges you faced along the way. We understand how frustrating it can be, and we’re continually working to make Rank Math as seamless as possible out of the box.

    If you encounter any more issues or need further assistance, please don’t hesitate to reach out. We’re here to help.

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

The ticket ‘Sitemap has draft products in it (added it to WP Rocket as Cache exception)’ is closed to new replies.