WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Erfo
    Member
    Posted 1 year ago #

    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: 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.

    http://wordpress.org/plugins/wordpress-seo/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic