Title: replace invalid URL characters function
Last modified: August 18, 2016

---

# replace invalid URL characters function

 *  [drzax](https://wordpress.org/support/users/drzax/)
 * (@drzax)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/replace-invalid-url-characters-function/)
 * Hi all.
 * I’m wondering if WordPress has a function anywhere that replaces invalid url 
   characters. e.g. turns spaces into ‘%20’ etc.
 * I figured there would already be one there so why bother writing it myself. I
   just don’t know where it is. Anyone?
 * S.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ryan Boren](https://wordpress.org/support/users/ryan/)
 * (@ryan)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/replace-invalid-url-characters-function/#post-156045)
 * php provides [rawurlencode](http://us2.php.net/manual/en/function.rawurlencode.php).
 *  Thread Starter [drzax](https://wordpress.org/support/users/drzax/)
 * (@drzax)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/replace-invalid-url-characters-function/#post-156048)
 * Cheers ryan

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘replace invalid URL characters function’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [drzax](https://wordpress.org/support/users/drzax/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/replace-invalid-url-characters-function/#post-156048)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
