Trailing Slash

#4923
Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    I am going to go ahead and assume that you want to remove the trailing slash from the links on your sitemap. If this is the case, you can make use of the below code and add it in your functions.php file:

    add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){
    	$url['loc'] = untrailingslashit( $url['loc'] );
      return $url;
    }, 10, 3 );

    I hope this info helps. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Trailing Slash’ is closed to new replies.