Title: Text Widget adding \ characters
Last modified: August 20, 2016

---

# Text Widget adding \ characters

 *  Resolved [AshGloverZA](https://wordpress.org/support/users/onepartscissors/)
 * (@onepartscissors)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/)
 * Hi all
 * The latest version of WordPress is behaving oddly – when i try and add a ‘ or
   a ” character to the text widget, it adds a \.
    If i click save 3 times, it will
   add an extra \ to every \ that’s there so it looks like this:
 *     ```
       Text:
       "
       *click save*
       Text Returned:
       \"
       *click save*
       Text Returned:
       \\\"
       *click save*
       Text Returned:
       \\\\\\\"
       *click save*
       Text Returned:
       \\\\\\\\\\\\\\\"
       ```
   
 * and so on. It seems to be stuck in some sort of loop that just keeps adding \’
   s to any character it doesn’t like.
 * The odd thing is, i added a plugin called PHP Code, and it behaves the same –
   thereby breaking any php you might put in there. I also tried installing HTML
   RAW, but that didn’t work.
 * Anyone else getting this? please help!

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

 *  [Brad Markle](https://wordpress.org/support/users/imh_brad/)
 * (@imh_brad)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397391)
 * Hi onepartscissors. I was not able to replicate the problem. Have you tried to
   disable all of your plugins and then test again to see if a particular plugin
   is causing the problem?
 * Be sure to start from scratch, as in add “test’s” to a text widget and then test
   again.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397397)
 * I would avoid using single quote or special characters in a text widget unless
   wrapped in an element that supports it.
 *  [Brad Markle](https://wordpress.org/support/users/imh_brad/)
 * (@imh_brad)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397544)
 * Hi onepartscissors, were you ever able to figure out what was causing the excessive
   slashes?
 *  Thread Starter [AshGloverZA](https://wordpress.org/support/users/onepartscissors/)
 * (@onepartscissors)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397545)
 * Hi Brad – i wasn’t able to find the problem. I’ve removed all the extra plugins,
   it’s mystery. i’m going to re-upload the wordpress core, maybe something was 
   corrupted in the upload.
 * [@swansonphotos](https://wordpress.org/support/users/swansonphotos/) – that’s
   the problem – even if i try and do completely legitimate html it will do this:
 * `<a href="http://google.com">google.com</a>`
 * becomes:
 * `<a href=\"http://google.com\">google.com</a>`
 * and if i click again it becomes:
 * `<a href=\\\"http://google.com\\\">google.com</a>`
 * and when i view the front end – that link tries to go to:
 * `http://%22http//google.com///%22`
 * unless i find an answer soon i’m going to have to give up and hard code the theme
   to make these blocks, but that will be an awful awful development, because it
   severely limits the client’s editing abilities in the sidebar!
 * [@brad](https://wordpress.org/support/users/brad/) – can I give you access to
   the site so you can look and see if i’ve missed something obvious? We can do 
   that via email?
 *  [Brad Markle](https://wordpress.org/support/users/imh_brad/)
 * (@imh_brad)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397546)
 * Hi onepartscissors,
 * Technically, what I believe is happening is that (99% sure):
 * PHP’s [addslashes](http://php.net/manual/en/function.addslashes.php) is adding
   those slashes to the database itself.
 * When they’re printed to the screen, they should be printed using [stripslashes](http://php.net/manual/en/function.stripslashes.php).
 * Because stripslashes is not remove those slashes, it’s adding additional slashes(
   over and over again).
 * ———————————
 * > The PHP directive magic_quotes_gpc is on by default, and it essentially runs
   > addslashes() on all GET, POST, and COOKIE data.
 * My php setup has magic_quotes_gpc set to Off. What I would recommend is that 
   you [use a phpinfo file](http://codex.wordpress.org/Finding_Server_Info) to determine
   if you’re setup has magic_quotes_gpc set to On or Off. If it is set to On, I 
   suggest setting it to off and then testing again.
 *  Thread Starter [AshGloverZA](https://wordpress.org/support/users/onepartscissors/)
 * (@onepartscissors)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397554)
 * Brad Markle, you have saved the day! Genius, sir!
 * The hosting company just moved the site to php 5.3.3, and in doing so, reset 
   all those settings, and magic quotes was on (and register_globals!) so i put 
   that all off like it’s meant to, and it’s working perfectly!
 * Thank you so so much for your input!

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

The topic ‘Text Widget adding \ characters’ is closed to new replies.

## Tags

 * [text widget](https://wordpress.org/support/topic-tag/text-widget/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [AshGloverZA](https://wordpress.org/support/users/onepartscissors/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/text-widget-adding-characters/#post-2397554)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
