When your WordPress blog is getting a lot of spam comments, Akismet is one of the must-have plugins. However, Akismet has a nasty side effect — it keeps all the metadata about the deleted spam comments in the wp_commentmeta table of your WordPress database.
What will you learn in this post?
I will show you how to:
- check the amount of comment metadata in your database
- remove all comment metadata created by Akismet
- repair your database
Mountains of Metadata
How much metadata are we talking about exactly?
Well, in case of a WordPress blog I manage, the amount of data slowly sneaked up to above 1.5 GB.
Yes, that’s correct — an incredible 1.5 gigabytes of useless waste data!
The comment metadata that Akismet generated over the years has completely taken over the SQL database of this blog. More than 95% of the database was made up of this waste data.
Obviously, this needed to be sorted right away.
The best and easiest way to get rid of the comment metadata is by using Lester Chan’s WP-DBManager plugin.
Step 1 — Backup Your Database
After installing and activating the plugin, create a fresh backup of your database before making any changes to it.
Please, use my earlier post as a reference regarding the database backup process, as well as a guide to setting up the WP-DBManager plugin.
Step 2 — Check Your Database Tables
If you are not sure what is the extent of waste comment metadata kept in your database, check your database tables first.
Check the numbers in this row very carefully. Especially the number in the column called
Step 3 — Remove the Metadata
To remove all the comment metadata created by Akismet, go to
DELETE FROM wp_commentmeta WHERE meta_key LIKE '%akismet%'
To run the query, copy (
The execution of this query will take just a moment.
Step 4 — Repair the Database
Finally, go to
The results are self-evident:
Thanks to identifying the problem with Akismet’s comment metadata, more than 1.5 GB of space could be freed up on the hosting server’s hard drive.
After the repair of the database, it will certainly perform a tad faster, too.
Liked this post?
Subscribe to our newsletter to receive early notification of new posts and deals: