Hello,
I have checked your site and I can see that the URLs that you’ve shared here are being redirected and yet, are appearing in the sitemap.
However, I saw that you haven’t redirected these URLs using the Rank Math’s Redirection Module.
May I know how are you redirecting these URLs so that I can investigate this further?
Looking forward to helping you.
Thank you.
Thank you very much for the reply. Of course, as I told you, I have migrated from yoast seo to rank match, so it is impossible that I could do it with the rank match redirect module.
The redirection is done manually via htaccess. This is the redirect:
RewriteRule ^la-smile-of-almu.*$ https://www.almugmcoach.com/blog-coaching/ [R=301,L]
Greetings
Hello,
The URLs should be removed from your sitemap automatically if they are already redirected.
I see that you have already added this filter to your active theme’s functions.php
file:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
In this case, here’s a filter to manually remove URLs from your sitemap:
add_filter( 'rank_math/sitemap/entry', function ( $url, $type, $object ) {
$urls_to_skip = array(
'https://yourdomain.com/redirected-URL-1',
'https://yourdomain.com/redirected-URL-2',
'https://yourdomain.com/redirected-URL-3',
);
if ( isset( $url['loc'] ) && in_array( $url['loc'], $urls_to_skip ) ) {
return false;
}
return $url;
}, 10, 3 );
You may need to update the URLs in the filter with the actual URLs that are still showing in your sitemap.
I hope that helps.
Thank you.
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.