Hello,
Thank you for contacting Rank Math today.
You can change the archive URL that the plugin uses for the sitemap by making use of the following filter with some custom logic on your functions.php file:
/**
* Filter the URL Rank Math SEO uses in the XML sitemap for this post type archive.
*
* @param string $archive_url The URL of this archive
* @param string $post_type The post type this archive is for.
*/
add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){
return $archive_url;
}, 10, 2 );
Looking forward to helping you. Thank you.
Thanks for the reply! That’s anice solution. Yet I am not pro at php code,
would you be specific how to use that code?
Old URL : example.com/1/ & example.com/2/
New URL : example.com/new1/ & example.com/new2/
where shall I put the url?
Also what do the “10” and “2” mean in that code?
Thanks!
-
This reply was modified 4 years, 7 months ago by Ray.
-
This reply was modified 4 years, 7 months ago by Ray.
-
This reply was modified 4 years, 7 months ago by Ray.
Hi Ray,
I am sorry but you need basic knowledge of PHP to make it work.
There is a simpler solution to removing something from the sitemap:
1. Mark it as noindex:
https://i.rankmath.com/UGciOq
2. Exclude it from the Sitemap at WordPress Dashboard > Rank Math > Sitemap Settings.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
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.