Hello,
Thank you for contacting us.
Could you please share some of the affected URLs so that we can check them on our end?
Also, please follow the below steps and see if that removes those URLs from the sitemap:
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. Clear your website and browser’s cache.
With that being said, you can use this filter to filter the items before they’re added to the sitemap: https://rankmath.com/kb/filters-hooks-api-developer/#filter-sitemap-item
Hope this helps.
Thank you.
Thank you for your prompt response.
I pass you the two screenshots:
http://prntscr.com/1tcb3a2
http://prntscr.com/1tcb7wp
Hello,
I tried to check your sitemaps but I was blocked by a forbidden error. Here’s a screenshot: https://i.rankmath.com/GXzGiB
The same forbidden error is received when we try to access the affected URL: https://i.rankmath.com/zeQjXQ
Please verify the situation and let us know so that we can investigate further.
Looking forward to helping you.
Thank you.
Thank you for the notice and sorry for the inconvenience.
Apparently it was due to the cache plugin.
Can you try logging in again.
Thanks
Hello,
I checked the sitemap URL and i can the archive page is indeed showing.
If page doesn’t have the Page ID, You can the remove the archive page with the help of filter, Use the below filter code :
add_filter( 'rank_math/sitemap/post_type_archive_link', function ( $link ) {
//Add a conditional statement like:
if ( strpos( $link, '%project%' ) !== false ) {
return false;
}
return $link;
} );
Make sure to modify it according to your needs.
Hope this clarifies your doubts. Let us know if you need any further assistance.
Hello,
We just wanted to get in touch to see if this solution has helped you or not.
In case it didn’t, please let us know and we’ll do our best to assist you.
Thank you.
Thanks for your answer.
Sorry para the snippet doesnt work.
You can check that the first url with the slug /projects/ is still in the sitemap.
https://www.parkingsymarquesinas.com/portfolio-sitemap1.xml
Regards
Hello,
Could you please test the following code?
add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ) {
if( $post_type === 'project' ) {
return false;
}
return $archive_url;
}, 10, 2 );
This should help remove the archive link from the project CPT sitemap.
Don’t hesitate to get in touch if you have any other questions.
Sorry, I meant to write Miguel instead of Antonio.
By the way, I forgot to comment that the snippet doesn’t work.
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
We updated the snippet on your website with the appropriate CPT name and now the archive URL is no longer showing on that sitemap.
Don’t hesitate to get in touch if you have any other questions.
Miguel,
Bravo, it works
Thank you very much for your willingness to help.
You can be proud
Thanks
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.