Using plus (+) sign instead of space (-) in WordPress URL

How to change space (-) sign to plus (+) sign in clean URL WordPress?

Like:

http://www.whitelotuscorporation.co.in/anax_wp/about-us/

to:

http://www.whitelotuscorporation.co.in/anax_wp/about+us/

You can see where the change need to be done— about+us instead of about-us in the URL.

2 Answers
2

This isn’t possible without modifying a core file. The function WordPress uses for this is called sanitize_title_with_dashes You can find it in wp-includes/formatting.php on

It doesn’t offer any filters, so you will need to make a change to this line:

$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );

I wouldn’t recommend modifying core WordPress files at all, so if you do this, be sure to try it out on a test site before implementing it – and even then make sure you have everything backed up.

Leave a Comment