Support » Fixing WordPress » “Bad, bad client code”

  • I have a client that has written some bad coding using Word. So, I’ve tried a search and replace through phpMyAdmin using both:

    UPDATE wp_posts SET post_content = " where post_content like '<font%'"
    UPDATE wp_posts SET post_content = REPLACE (post_content,'<font%','');

    and no luck. MySQL doesn’t find the instances of the bad <font tags and needless to say I can’t delete them.

    Any mysql help would be much appreciated.


Viewing 4 replies - 1 through 4 (of 4 total)
  • I have a client that has written some bad coding using Word.

    Is there such a thing as “good” code written using Word? 🙂

    You may have better luck if you dump the database and open it with a text editor. Then you can look around and see what the code looks like and do some search/replace to clean it up. Once you have it clean, then drop your tables and import the sql file back into the database. Just be sure to keep an original copy of the dump in the event things don’t turn out well…that way at least you’ll be able to recover to what you have now.

    Figaro, Thanks for your reply.

    I’ve tried that… several times. Unfortunately the result is always a broken field her or there, leaving me with mush. I’ve tried comma-delimited, tab delimited and even pipe delimited and no good. The least cumbersome way is SQL command with wildcard.

    Well, if he/she copied and pasted Word stuff into posts and pages, then that’s almost impossible to clean-up directly in the db. Some rich text editors have the Word cleaning icon that seems to do a pretty good job. There is probably a way to add that to the WP editor, but I haven’t tried it. If you do that, maybe you could open the posts and clean them that way…tedious, but…

    Thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Bad, bad client code”’ is closed to new replies.