The inserted image-link “Productsitemap” doesn’t work. How can I attach an image easyly?
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
Our plugin includes the post-type archive link as the very first URL in the different sitemaps, and that page is the archive page for the products.
To remove it, you would need the following filter:
add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){
if($post_type == 'product') {
return false;
}
return $archive_url;
}, 10, 2 );
The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php
I hope that helps.
Thank you.
Hi and thanks for your reply!
I inserted the code into my child themes functions.php – but nothing changes.
Do I have to something else? Or just wait?
Best regards!
Hello,
Please flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
Once done, clear your website cache and check the sitemap.
Hope this helps.
Thank you.
Yeah! That’s it!
Thank you very much!
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.