Support » Fixing WordPress » WP adding forward slash to all links

  • I just tried to add a new blog post. I write it in Dreamweaver, then past the code in WP.

    Now WP is putting the “\” in front and after all URL’s, rending them useless. When i try to delete them, it puts back two “\\”

    WTF is going on? I upgraded to the current version a couple weeks ago, and have had no problems up to now.

    If anyone can be of assistance, that would be great. iMac 10.6.4, 2.8GH core i7
    12GB ram, wp 3.01, nothing done for 2+ weeks, and last post was a few days ago with none of these problems.

    Will restart and repair permissions & see if I have a Disk Warrior CD to also repair permissions, though I can’t see a permission problem putting in the forward slashes.

    This sucks.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter cwinkler

    (@cwinkler)

    Any help please?

    Repaired disc & permissions on my Mac by booting on start up disc. Tried to post again, saved draft, and bam! Slashes on both ends of any URL or link.

    Anyone else have this problem?

    Any help is greatly appreciated.

    Those are back-slashes and not forward slashes. Could be magic quotes? Trying to escape characters? I avoid mixing dreamweaver (and similar apps) with WP but it could be adding in characters that are the cause.
    Might also help to know the specific envireonemnt.

    Thread Starter cwinkler

    (@cwinkler)

    I have not seen this problem in the 4 years I have been using WP.

    I paste in this:

    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, a Hartford county circuit judge bitch slaps the state of Maryland, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970’s.</p>

    and when I hit “Save Draft”, it changes it to this:

    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, a Hartford county circuit judge bitch slaps the state of Maryland, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970’s.</p>

    It has nothing to do with Dreamweaver, it’s just code. This is how I have been doing things for years and all of a sudden it’s WP that is doing this.

    I recently upgraded to the latest version, and using a custom theme. I have asked my coder for help, just wondering if anyone else can help.

    Both things you pated are identical on here. Tells me nothing.

    Thread Starter cwinkler

    (@cwinkler)

    Interesting, now when I paste in the backward slash here as code, it shows up just fine here. WP actually does not have a problem displaying it, yet I get errors when I preview the page on my blog. I’ll try again and will paste between the code quotes to see what it is doing.
    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, <a href="http://blog.washingtonpost.com/story-lab/2010/09/wiretapping_charges_dropped_ag.html" target="_blank"><strong>a Hartford county circuit judge bitch slaps the state of Maryland</strong></a>, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970's.</p>
    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, <a href=\"http://blog.washingtonpost.com/story-lab/2010/09/wiretapping_charges_dropped_ag.html\" target=\"_blank\"><strong>a Hartford county circuit judge bitch slaps the state of Maryland</strong></a>, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970's.</p>

    Thread Starter cwinkler

    (@cwinkler)

    As you can see, the 2nd ppg above has the backslash that WP is putting in the code, yet wordpress does not mind in my post after webjunks 1st reply.

    Yet when I preview on my blog, one of the links it sends is: http://www.eyespypro.com/blog/%5C%5C%22http:/www.eyespypro.com/blog/death-of-the-spy-camera/%5C%5C%22

    which is garbage and gives me errors. And any images I paste are jibberish also.

    Does this help?

    Thread Starter cwinkler

    (@cwinkler)

    And every time I save the draft, it puts another backward slash, so now it’s like this:
    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, <a href=\\"http://blog.washingtonpost.com/story-lab/2010/09/wiretapping_charges_dropped_ag.html\\" target=\\"_blank\\"><strong>a Hartford county circuit judge bitch slaps the state of Maryland</strong></a>, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970's.</p>

    Thread Starter cwinkler

    (@cwinkler)

    And every time I save the draft, it puts another backward slash, so now it’s like this:
    <p>In a stunning blow to oppressive big government misapplication of laws against honest citizens, <a href=\\"http://blog.washingtonpost.com/story-lab/2010/09/wiretapping_charges_dropped_ag.html\\" target=\\"_blank\\"><strong>a Hartford county circuit judge bitch slaps the state of Maryland</strong></a>, and rules that a citizens use of a camera to record the rogue actions of its state troopers, who pulled a gun on a speeding motorcyclist, do NOT fall under the antiquated wiretap laws of the 1970's.</p>

    That is called Magic Quotes. The backlashes are added so that the quotes are interpreted as quotes and not part of PHP code.
    Check in your theme files to see if they have “add_magic_quotes” in there. That is the WP function to do that.
    Also if that did not help, could be your host upgraded to new version of PHP.
    look in WP-Settings.php (main WP directory) and look for a line like:
    set_magic_quotes_runtime( 0 );

    change it to:

    if(version_compare(PHP_VERSION, '5.3.0', '<'))
    {
    set_magic_quotes_runtime(0);
    }

    Thread Starter cwinkler

    (@cwinkler)

    I don’t have those brackets on my doc.

    I see this:

    // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
    set_magic_quotes_runtime( 0 );
    @ini_set( ‘magic_quotes_sybase’, 0 );

    and later , this

    // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
    wp_magic_quotes();

    When I changed the first one like you said, it did nothing.

    Your help is really appreciated!

    Go back to the line in wp-settings.php:
    set_magic_quotes_runtime( 0 );
    and this time comment the line entirely.
    /* set_magic_quotes_runtime( 0 ); */

    See if that fixes the problem.
    ————————
    Lastly you can try below the lines in wp-settings.php:

    // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
    wp_magic_quotes();

    add this:

    if ( get_magic_quotes_gpc() ) {
        $_POST      = array_map( 'stripslashes_deep', $_POST );
        $_GET       = array_map( 'stripslashes_deep', $_GET );
        $_COOKIE    = array_map( 'stripslashes_deep', $_COOKIE );
        $_REQUEST   = array_map( 'stripslashes_deep', $_REQUEST );
    }

    Thread Starter cwinkler

    (@cwinkler)

    #1 does nothing

    #2 takes down the site.

    Do I add it after the info above it, or do I replace it with?

    hhhmmm. What exactly is the environement you have WP running under?

    If you have a PHP.INI put in a line:
    magic_quotes_gpc = Off

    That turns magic quotes off for PHP.

    Not sure why #2 what take down the site. You could place it in the template file (page.php, single.php, etc.) for the problem page. Did you receive an error? The only thing that does is check if magic quotes is enabled and then remove slashes.

    Thread Starter cwinkler

    (@cwinkler)

    I see what I did, I left the { in the part you wanted added.

    Now it works fine!

    Thanks so much, it has prevented me from blogging on a very important court ruling for personal freedom & privacy.

    I REALLY APPRECIATE YOUR HELP WEBJUNK!!!!!

    Thread Starter cwinkler

    (@cwinkler)

    Now last thing, every time I save a draft, it adds extra space between <p> marks.

    so if I change it a couple times, the space between the paragraphs increases. while it only shows up in the editor, and not on the page, why would the blog start adding all this space between the code?

    Thanks again,

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘WP adding forward slash to all links’ is closed to new replies.