In this short article we will cover – How to clean WordPress Database after uninstalling bbPress ? Many times we receive a good volume of spam on bbPress below steps will help you cleanup your database.
Pre-requisite: Backup your Database and Website. Backup is very important as in case something goes wrong you should be recover your website with no problem.
Deleting Spam from Database
Step 1: Login to your Web-hosting account and go to its Control Panel (cPanel).
Step 2: Ensuring we have a database backup. Go to phpMyAdmin > Make a Database Backup by exporting the database.
Step 3: In phpMyAdmin go to your websites database and we will be working with these 2 tables –
_posts
_postmeta
And what we are looking to delete is posts by id which are in the range where bbPress spam happened
Pro tip: Easy way to find range is make several select statements to see your data at different post id ranges (also check your last created posts id) and figure out from where to delete the posts.
Example – Query like this will get rid of the spam in _posts table
DELETE FROM `blog_posts` WHERE `blog_posts`.`ID` < 4292 and `blog_posts`.`ID` > 2267
and similar query to this will help you clean your _postmeta table as well.
Pro tips: When working with a database please pay attention to the table structure and columns to first understand the table and then execute any delete query using your technical skills.
Select statement are always a safe way to understand databases.
Step 4: Correct Auto-increement value of your table, this will you continue your posts/ids before spam hit your site.
After all the cleanup, check what’s your last left post id.
Select table > Go to Operations
Change Auto-increment value to the last post id. And you are sorted for now.
And if you want to remove bbPress overall from your website, you can use the steps in the video tutorial below.