Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Please note that to make the attachment sitemap work, you need to make sure that the option “Redirect Attachments” is disabled in Rank Math > General Settings > Links as shown in the screenshot below:

If you already done that, 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/
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Perfect, Jeremy, thank you! Number 1 solved it for me!
Thank you for the quick and clear reply. Keep up the great work, Jeremy! ๐๐ฅ
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.