Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I change the - to a + in the URLs, automatically?

http://website.com/post-name/
http://website.com/post+name/
share|improve this question
    
Do you want to do it manually or automatically when the post is created? –  Anagio Mar 12 '13 at 7:33
    
yes automatically –  user2128747 Mar 12 '13 at 7:47
    
What is your permalink structure (update your question please)? –  kaiser Mar 12 '13 at 8:41
    
have you tried custom structure in Permalink settings? –  MidhuN Mar 12 '13 at 8:47
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.