WordPress.org

Ready to get started?Download WordPress

Forums

"Bad, bad client code" (5 posts)

  1. David Radovanovic
    Member
    Posted 5 years ago #

    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%'"
    and
    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.

    Thanks!!

  2. figaro
    Member
    Posted 5 years ago #

    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.

  3. David Radovanovic
    Member
    Posted 5 years ago #

    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.

  4. figaro
    Member
    Posted 5 years ago #

    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...

  5. David Radovanovic
    Member
    Posted 5 years ago #

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic