Yoast SEO
Remove final slash from Post Type and Sitemap (1 post)

  1. Erfo
    Posted 2 years ago #

    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: http://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 http://www.example.com/events/ ...
    But the final slash is still visible in the sitemap.xml

    How can I resolve, please? Thanks.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic