Support » Fixing WordPress » Why is WP adding a \ in front of every ” ?

  • Hi I’m really having problems trying to set up a sign up box.
    I copy the raw html code from Aweber to the sidebar area of my theme but WP inserts a \( backslash) in front of all my ” (quotes).
    for example an original line looks like this;
    <input type="hidden" name="meta_split_id" value="">
    this is what happens after I copy it into the WP theme;
    <input type=\"hidden\" name=\"meta_split_id\" value=\"\">

    Whats more curious is that if I don’t do anything and just his save again it continues to ad more \ (backslashes) like this.
    <input type=\\\"hidden\\\" name=\\\"meta_split_id\\\" value=\\\"\\\">

    help would be appreciated.
    thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Take info located here with a grain of salt, but a good reference point just the same.

    More interesting reading.

    Getting Rid of Unwanted Backslashes in WordPress Form Input

    Thread Starter jimjohnger

    (@jimjohnger)

    from what I have read so far this looks like what is happening.
    I will try to figure out how to turn off these magic quotes in the php.ini file and see if it works.
    thanks,

    radop

    (@radop)

    Hey,

    I just came across the same issue, when trying to add text in an about box in a theme, it automatically puts in the ‘\’ before every ‘.

    I read the 2 articles, but its not clear where you have to put in the strip code, and I don’t have access to the php.ini file, as I am hosted on a server.

    Any ideas?

    Bruce

    From the second link.

    The above code strips slashes when data arrives via $_POST, $_GET, $_COOKIE, and $_REQUEST methods. In my case, I’ve pasted this code inside my functions.php file which contain my theme options. This page alone will serve multiple textarea input fields which will allow special characters such as Google Analytics and AdSense code. Note that this can be used in any page with input fields such as a contact and RSVP forms.

    radop

    (@radop)

    Tks all,

    I had put in the code in the functions.php but I never updated the actual text in the about box, so it was not reading it right.

    I just forced a change and it works now.

    Tks again.

    Bruce

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Why is WP adding a \ in front of every ” ?’ is closed to new replies.