Hello,
We apologize for the issues you are facing with your sitemap. Thank you for raising these concerns.
-
Sitemap Not Reflecting All Posts: If your sitemap is not showing all posts, it could be due to custom canonicals. Rank Math includes a self-referencing canonical for all posts set to Index. If any of your posts have a custom canonical, they will not appear in the sitemap. To ensure all posts are included, please remove any custom canonicals from your posts and allow Rank Math to generate the canonical.
-
Last Modified Date Not Updating: The last modified date in your sitemap is determined by the ` tag. If this date is not updating, it may be related to caching issues. Even if you believe you've excluded the sitemap from caching, it's worth double-checking your cache plugin settings to ensure that the sitemap is indeed excluded from caching. Additionally, you can try adding 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');
For further assistance, please reply to this ticket, and a human agent from the Rank Math Support team will take over and provide more detailed help.
Thank you for your patience!
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Please follow the steps below:
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. Apply the following filter code to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter to your WordPress site:https://rankmath.com/kb/wordpress-hooks-actions-filters/
If the issue persists, please share the affected post URLs that are missing in your sitemap so we can check them closely.
Looking forward to helping you.
Thank you,
The sitemap correctly reflects the number of post after step 1.
We have implemented step 2.
As for step 3, do you have any guideline for plugin WPCode Lite?
Hello,
You should add the code as PHP Snippet to your WPCode plugin like in this image

Then choose Auto Insert and Run everywhere at the bottom.
Looking forward to helping you.