Free up MySQL Space in WordPress – Delete Akismet Logs

Author posted by Jitendra on Posted on under category Categories Web Technology and tagged as Tags , with 1 Comment on Free up MySQL Space in WordPress – Delete Akismet Logs

Free up MySQL Space in Wordpress – Delete unused Akismet Logs

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.

Related posts

  • This is exactly the problem I’m having. My blog is slowed down a lot because of this problem. My table commentmeta has > 100k row, and > 100MB size (uncompressed)! After remove it, wow, it’s < 1 MB, and website is much faster!