Submit Your Article Forum Rules
Results 1 to 7 of 7

Thread: Botched punctuation

  1. #1

    Botched punctuation

    I just helped a client to recover and re-install an old wordpress blog that was still running version 2.1.2 (that's from 2007 for those of you old enough to remember).

    The old theme wasn't compatible with the new wordpress, so I'm using Twenty Ten for now.

    Now I notice that there's a lot of instances of bad punctuation in the blog posts -- usually where smartquotes have been turned into gobbledygook. Sometimes an e with an accent (like in the word cliche) is botched.

    Is there a way to globally fix this in the blog? There's hundreds of posts. I'm wondering if the choice of theme has something to do with it, or if I should re-import the database or xml back-up somehow. (First I'd have to compare and contrast the back-ups to see if the problem is there, too.)

    ---------- Post added at 10:25 PM ---------- Previous post was at 10:14 PM ----------

    I just checked the XML back-up, and it's human readable, although it's full of smartquotes and m dashes. I can replace all those, but the French characters (e with an accent) will be a problem. I'd like to leave those alone!

    In any case, if I DO import that XML file, how do I avoid the problem of double posts? Do I have to delete all other posts and pages first? Sounds apocalyptic.

  2. #2
    Moderator chrisJumbo's Avatar
    Join Date
    Oct 2005
    Near Sacramento, CA
    This happened to us when we move from an older version to a newer. But our posts had random question marks. Never found a good solution. An update query might work in phpMyAdmin if you can cut and paste the offending character. You can always try it on one post ID and if successful update globally.

    cd :O)

  3. #3
    You can easily edit individual characters through mysql.

    You can run a command that looks like this:

    UPDATE wp_posts
    set post_content = REPLACE(post_content, "replace_this", "with_this");
    I use Hidden Content as added security for my networks and servers.

  4. #4
    I've never run commands on mysql before. Can you give me an idea how to do this? I'm in the Dreamhost panel -- I see "cron jobs" as a choice. Is that right?

  5. #5
    There are many ways to do this. But essentially they all mean using your Phpmyadmin to replace the offending characters. One option is to navigate to the Databases section in your control panel and locate the Phpmyadmin application and start it. Then in the window where the phpmyadmin is running - select the wordpress database on the left pane. You can issue the statement Tech Manager has shown in a SQL window there.

    Another option is to download the complete dump of the database and open the sql statements in a good text editor (Editplus, Notepad++ or whatever you have) and use the global 'search and replace' function in that editor. Once done, you reload the database into the server. This method is far more reliable and makes editing a breeze.

  6. #6
    I'll probably do the second option. I don't see phpmyadmin in this Dreamhost panel, although I've used it before with other clients.

  7. #7
    I'm back. I experimented with backups of the mysql database (without the benefit of phpmyadmin) but got myself into trouble. So instead, I started a new mysql db and directed the new wordpress install to it. Great -- a new blank db with no pages or posts.

    Then I went to import my XML back-up from the old wp 2.1.2 blog. Import error! According to this post ( ) I needed to hack the code to fix a wxr issue. Now it would import. And the punctuation was fine!

    But... now all 2000 posts are in the "uncategorized" category. Hm. I'm working to fix that now.

    ---------- Post added at 09:52 PM ---------- Previous post was at 08:24 PM ----------

    A couple hours later... Looks like the only reliable way to maintain categories was to use a special exporter plugin back before I nuked the old blog.

    Now I'm looking at mysql db changes again. I found phpmyadmin by the way. (It was hiding.)

    ---------- Post added at 10:21 PM ---------- Previous post was at 09:52 PM ----------

    Back again. Went back to an early db backup. This time I turned off all plugins and turned them on one at a time -- when "NextGEN Gallery" wanted to perform some database upgrade, I denied it. Instead deleted it and reinstalled it. It looks like this was the culprit, because I blindly let it update the db in the past.

    Now the photo galleries are broken, but hopefully that's a minor concern compared to the dozens of punctuation replacements I would have to do. (There were some weird ones, trust me. Lots of French characters to consider.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts