We might often need to create a bulk number of posts and comments to test the performance of our plugins and theme. This is quite essential to understand in advance, the performance-related issues that might come up when our site grows big. Once we are done with testing, deleting numerous posts and comments becomes an issue. In this guide, I will be cover two different methods to bulk delete all posts and comments in WordPress.
Method1: Bulk delete via admin
WordPress has a custom section for deleting the posts and comments. For navigating to this section we have to first login to our admin dashboard and then click the posts page in our dashboard.
Normally WordPress displays about 20 posts on a single page. So to delete 1000 posts we need to do the process repeatedly for 50 times. Hence to avoid this, we are going to modify the post count per page and then proceed with deleting the posts. For this first, we have to click the Screen Options tab on the right top corner.
A new section will appear on the screen as shown below.
Here we have to modify the number of items per page under the pagination header. While doing this we may be tempted to give much higher values like 500 or 1000. But this is not recommended because while performing delete for bulk number of posts in a single go, the chances of WordPress installation becoming unresponsive is quite common. I have selected the number of items per page as 200. Now click the Apply button to save the changes.
Now let us click the checkbox to the left of the title text to select all the posts on the page. After this let us go to the drop-down with default value Bulk Actions and select Move to Trash option from the drop-down.
After this let us click the Apply button. Now WordPress will start deleting all the posts on this page. In our case, it would be 200 blogs. It took me about 4-5 min for the process to complete. I have tried with higher values of posts per page like 500 but it ended up in the WordPress installation becoming unresponsive.
So this method of bulk deleting the posts would be suitable only if the number of posts is not very high. Suppose we have thousands of posts on our website, then to delete all of it in a single step we would have to go with plugin option as mentioned below.
Method2: Bulk delete via a plugin
First, we have to install the Bulk Delete plugin. This plugin is pretty popular and has 50000+ active installations. If you are not sure how to install plugins, you can refer our guide on the plugin installation. After installing and activating the plugin we can see an option in the admin panel as shown below.
Now select the bulk delete posts option from this. This will display a new section.
Here we can select the posts to be deleted using a variety of available options such as post status (published, scheduled, draft, pending, private, spam), age of posts, etc. We have the additional option of moving the posts to trash or deleting it permanently. Suppose we have tens of thousands of posts there might be a chance that the execution may get timed out. We can also specify the number of posts to be deleted in a single step.
After selecting the options we have to click the Bulk Delete button at the bottom part of the section. The process took me about 4 minutes for deleting about 888 posts. This may not be the case with everyone as the speed of deletion depends on a variety of factors. This plugin has many other useful options to explore. It has a section that enables us to delete the posts by category.
This plugin also has options to bulk delete pages, users, etc. Some of these features are available as add-ons. I have used this plugin several times and it worked out really well without any issues. Even though there are numerous plugins out there in the WordPress directory that does the same functionality I would always recommend this plugin.
Leave a Comment