Mass Delete of Posts

It can be a real pain to delete several (not to mention thousands) of posts using the built-in Manage/Posts section of the wp-admin panel. While there are a few bulk post management plugins out there, I wasn’t able to find one that worked as I needed it to.

Read on to find out how I made a simple tweak to one of these plugins and was able to painlessly delete massive amounts of unwanted posts.

The Problem:

So I had a WordPress driven site which had been configured to syndicate articles to a particular category. These titles would then appear as supplemental news items at the bottom of post pages. When I decided that I no longer needed these syndicated items kept as posts in my WordPress database, I was left with the dilemma “How am I going to delete these 3000+ posts from the database without getting into manual MySQL queries?

Unsuccessful Attempt

First I downloaded the Mass Post Manager plugin. I selected the target category and chose the option to delete all posts from the category, yet when I returned to the same plugin admin screen, the same 3000+ posts were still there! Now I’m sure this plugin works great in some environments, and it may work for you and yours. But as for my WP 2.5.1 site, it didn’t work.

Getting There…

Then I downloaded and installed the Batch Categories plugin and everything worked as it should, but there was one little problem: it only handles 15 posts at a time. The only advantage over using the built-in Manage/Posts admin interface is that with this plugin I could check the top ’select all’ check box and not have to worry about filtering out posts from the one category, as it filters them for you in the first step.

Success!

Hopefully, I opened the plugin file and found the area that set the post listing limit to ‘15′ and changed it to ‘500′. And whaddya know, it worked just fine!

Here’s the step-by-step:

  1. Download Batch Categories
  2. Unzip it to your computer and open the admin.php file
  3. Search for ‘15′ (line 22) and replace with a larger number (I chose ‘500′ and had no problems)
  4. Upload the entire batch categories folder to your ../wp-content/plugins/ directory and activate the plugin from your wp-admin panel.
  5. In your admin panel, go to Manage/Batch Categories. In the dropdown box select the category you wish to delete posts from, and click Filter

  6. Click the top check box to select all the listed posts and scroll to the bottom
  7. Be sure to select the target category again at the bottom or nothing will happen! Then click Remove From

  8. Rinse and repeat until all your unwanted posts are deleted

Moving Posts to Another Category

To move posts to another category you need to select the post, then at the bottom choose the new category that it will be assigned to and click “ADD TO”. Then on the next page select the post again, scroll to the bottom and choose the category you want the post removed from and click ‘REMOVE FROM’.