How can I change the -
to a +
in the URLs, automatically?
http://website.com/post-name/
http://website.com/post+name/
How can I change the -
to a +
in the URLs, automatically?
http://website.com/post-name/
http://website.com/post+name/
The post slug
is generated in the wp_insert_post
(…/wp-includes/post.php) function. The function calls another function to sanitize the your post title
. You can use the filter sanitize_title
(…/wp-includes/formatting.php) to replace -
by +
. This will change the behavior in more situations then just the title of a post. So you should check if it is a post title that is sanitized.