Hello,
Thank you for contacting Rank Math support and we apologize for the inconvenience.
We can see from your page source that these pages have already been set to noindex
– but they are still showing up on your sitemaps. Have you tried flushing and regenerating your sitemap? Watch this screencast to do that: https://i.rankmath.com/pipRDp
That said, you can actually use the rank_math/sitemap/entry
filter to forcefully remove the URLs from your sitemap. You can learn more about the filter here: https://rankmath.com/kb/filters-hooks-api-developer/#filter-sitemap-item
Here’s an example code, you can add to remove both URLs:
add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){
// List of URLs to exclude
$exclude = array(
'https://seasoft.com/products/',
'https://seasoft.com/solutions/'
);
// Check if the URL is in the exclude list
if ( in_array( $url['loc'], $exclude ) ) {
// Return false to skip this URL
return false;
}
// Return the original URL otherwise
return $url;
}, 10, 3 );
Try this and let me know if it worked for you. Thank you for choosing Rank Math!
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.