Support » Fixing WordPress » HOWTO: Repair code with escaped backslashes in WP 2.3.x

  • This should be of interest to those who post code with backslashes inside pre tags in their posts. A problem with WP escaping backslashes inside pre tags has been corrected in 2.3 – 2.3.1. But the code that has already been published does not show correctly.

    In order to repair the code, you need to:

    1. dump your database
    2. replace the escaped backslashes with non-escaped ones
    3. re-import the repaired dump

    The replacement can easily be done with sed. Assuming that mydb.sql is your wordpress database dump, repair the backslashes with:

    sed -i 's/\\\\/\\/g' mydb.sql

    Then re-import the dump.

    For more details and explanation, please read my lengthier post about how to repair your code.

  • The topic ‘HOWTO: Repair code with escaped backslashes in WP 2.3.x’ is closed to new replies.