Remove final slash from Post Type and Sitemap
-
Hi.
I activated the final slash from SEO > Permalinks.
I have the custom type post “events”. The permalinks of the template archive-events.php have the final slash (es: https://www.example.com/events/post-name/), so I added this code:function permalink_untrailingslashit($link) { return untrailingslashit($link); } add_filter('post_type_link', 'permalink_untrailingslashit');
and the final slash is no longer in the posts of https://www.example.com/events/ …
But the final slash is still visible in the sitemap.xmlHow can I resolve, please? Thanks.
- The topic ‘Remove final slash from Post Type and Sitemap’ is closed to new replies.