How To Edit Thousands Of WordPress Posts

Posted by Ad Hustler | Posted in Web Design | Posted on 14-12-2009

Every so often you get into the situation where you are running a wordpress blog that has thousands of posts that need a small portion edited.  Unfortunately, wordpress does not come readily available with a “find & replace” type function.  There are some “find & replace” plugins but they didn’t seem to edit the HTML within the posts the way I wanted.  Since it took me a little time to figure out how this is done, I figured I’d share it with you.

1) Open PHPmyAdmin

2) Click on the name of your wordpress database

3) Click on the “SQL” tab

4) Type the following code


5) Hit ‘Go’

That’s it.  You can literally “Find & Replace” anything within all of your posts within seconds.  Hope this helps someone.

Ad Hustler | Subscribe To Ad Hustler


  1. Hmm…I haven’t bumped into this on a large scale but glad that it appears to be easy. Thanks for the post!

  2. Watch out for this though…any mass editing of your database via SQL, if you’re not careful, could be disastrous. It’s smart to always keep a backup before making mass undoable changes! :)

  3. Sure this will come in handy one someday.

  4. Yeah, that’s a good way to replace something in any database.
    Specifically for WordPress you could also use the “Search and Replace” plugin, which does exactly the same (+ a few other things), but from the WP admin panel.

  5. @Erik – Yes I agree. Always make a backup of the database first. I did but luckily did not need to use it.

  6. I used this type of thing before when I had a barrowload of posts that were set for draft instead of published, saved a lot of time I can tell you

  7. This is a lame tip; give us something better.

  8. @temple – lick my balls

  9. Very useful, If only I know that three weeks ago.

  10. Yeah, sql… :) Make sure it’s not international spam comments you are trying to delete, I accidentally removed over 50,000 user records including emails, names, etc trying to delete all the russian “A”s as sql converted these russian “A”s to american. Complete database was gone in a few seconds. I almost cried. :)

  11. Great tip, you freaking rule. Now just tell me how to make my dating ads back out and I’ll be set :)

  12. Hey great post .Will definitely mark this on my RSS feed .Thanks.

  13. Cant believe I never thought of this, great for updating old affiliate products sitewide.. Thanks!

  14. @hustle- its fucking lame dude.

    Anyone who cant figure out “find and replace” on their own, doesn’t deserve to know.

    You seem to have at least some awareness on useful topics.

    Show me how to populate a wp installation from sql database content.

    That would be all kinds of useful.

  15. dating ads that have pretty women are very catchy –

  16. i often see a lot of dating ads on craigslist and also on facebook `-“

  17. ?????????? ??????.?????? ??????.????????? ?????? ??????.????????? ?????????????? ?????? ? ?????? ?????? ??????.????????? ?????????????? ?????? ? ??????! ??? ???? .

  18. How To Edit Thousands Of WordPress Posts | Ad Hustler I was recommended this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are wonderful! Thanks! your article about How To Edit Thousands Of WordPress Posts | Ad HustlerBest Regards Justin

  19. South African Airways & British Airways (op?r? via Comair) Economie Projet d’offre, ces soci?t?s et ces vols de 1?re monster beats classe entre ces grandes villes & ? certains vraiment petits, y compris Mthatha, Polokwane, Richards Bay, & Maseru. Ton tonus ainsi une couleur doivent se pr?senter comme choisies selon ton tonus du bouille et le dynamisme du peau.

Post a comment