Today I duplicated a site I have running in a certain niche. I needed to delete all the old posts from certain years, and couldn’t find a plugin to do this easily. So. I went into trusty old PHPMyAdmin and did it manually. Here’s what you need to do.
Login to phpmyadmin
Find your wordpress database.
Go to the
wp_poststable in the database.
sqltab in phpmyadmin, and use a variety of the following commands.
To Delete Posts By Date:
DELETE FROM `wp_posts` WHERE `post_date` like '%2008%';
To Delete Posts With Certain Content In The Body:
DELETE FROM `wp_posts` WHERE `post_content` like '%test_content%';
To Delete Posts With Certain Content In The Title:
DELETE FROM `wp_posts` WHERE `post_title` like '%test_content%';
Note that you will have to change the contents between the % and % in those sql statements to your own.
That’s it. Watch it delete your posts in just seconds, instead of hours and hours of work through the wordpress backend.
Hope this helps you out too.