Akismet is owsome plugin to protect your WordPress site from the spams. However, before writing this article, i was checking the space used by the database. I was so surprised when i saw that the table named “wp_commentmeta” was having more than 11k records using 20MB of the space.
After some time, i found that Akismet uses that table as a log to display the reports about spam. Spams are automatically deleted by akismet, but entry for every spam was maintained in that table.
When i run below query to find the orphan comments meta :
Select * FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments)
There were nearly 10k records which were orphans. To free up the memory, i run below query
DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments)
With the help of above query, i free up nearlly 18MB of space.
Please leave your valuable feedback over the same problem.
Leave a Reply