• I had to create all new databases for my blogs, because the version of MySQL I had used for the originals was too old. The transition went fairly smoothly, but now at the end of sentences, where there’s a period and two spaces (yeah, I’m an old school typist) Â appears.

    Is there a way to edit all those out in one fell swoop and replace them with a plain space? I don’t want to go through years of posts and fix them all individually if I can do it another way.

Viewing 7 replies - 1 through 7 (of 7 total)
  • This site may have one answer.

    I would use a different approach, just because I am more comfortable with it: Export out the table to an SQL file, edit it with a text editor, and import it back in.

    No matter which you choose, BACK UP FIRST!

    Thread Starter infmom

    (@infmom)

    Someone suggested capturing the page source into an HTML editor and using search and replace, but I have no idea where the cleaned-up file should be ftp’d to when I finished the job.

    If I understand correctly, that suggestion will probably not work because the text would have to be pasted back into each page.

    If you have access to phpMyAdmin or a similar tool to manipulate the database you should try the export/import method.

    Can you post a link to a page where the problem appears?

    Thread Starter infmom

    (@infmom)

    I have limited access to phpMyAdmin and am not sure how much manipulation I could do. Here’s a link: http://tattoo.infmom.net/page/2/

    How did you move the content from the old databases to the new ones? If you exported, did the exported file show the problem before you loaded it?

    If not, there is probably a difference in the character set between the export and the new database. Look in the exported file for the text ‘DEFAULT CHARSET’. The character set should probably be UTF-8. If it is not, try re-exporting the table and picking UTF-8 as the character set.

    If the  characters appear in the exported file, use a text editor to remove them and re-import.

    BACK UP FIRST!!

    If you can get into phpMyAdmin and select your database, try this query:

    UPDATE wp_posts
    SET post_content = REPLACE(post_content,CHAR(194),'')
    WHERE ID = 1

    Replace the ‘1’ with the ID of a post that has the problem. If that corrects that post, remove the WHERE clause and run against the whole table.

    Did I mention to BACK UP FIRST??

    Thread Starter infmom

    (@infmom)

    To move the database from the old version to the new one, I used the WP-DBManager plugin. I didn’t look at the exported file before I imported it because I didn’t realize it could be altered by the process of exporting or importing it. This whole move-the-database business was something I’d never had reason to attempt before.

    Being new to the process, I’m not sure I want to mess around with the database too much. When I have time, I may go back and edit a few months’ worth of posts manually and leave the rest as they are.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Batch edit odd characters from multiple posts?’ is closed to new replies.