Don’t Use Akismet

No doubt that Akismet is one of the best anti spam plugin for WordPress. But it’s not as good as I thought. The problem appear a few months ago when I noticed that my blog (Deluxe Blog Tips) ran too slow. People couldn’t comment or post new thread at support forum (which was a bbPress forum). Some kind people also sent me emails warning me and complaining me about that, because they really need support for some of my plugins. That forced me to dig into the problem and find a solution. Unfortunately, I found that Akismet is one of them, which made me really surprised as I always think any product from Automatic is well-tested and verified by the community.

The starting point – Database

One of the first thoughts in my head at that moment is optimizing database. I needed to remove redundant tables left by removed plugins, cleanup some orphan options, etc. I noticed a problem when I backed up my database before doing anything related to it. The size of the database is 27 MB (zipped) and 247 MB (unzipped), which is very high for a small blog with less than 200 article like Deluxe Blog Tips.

Looking to the table size I found this:

commentmeta Dont Use Akismet

Do you believe these numbers? More than 100k records with 170 MB? Are you kidding me?

What did Akismet do with my database

Looking at commentmeta table, I found the answer:

akismet comment meta Dont Use Akismet

Akismet simply logs its data. In my case, after running this query:

select count(*) from dbt_commentmeta where meta_key='akismet_as_submitted' or meta_key='akismet_history' or  meta_key='akismet_rechecking' or meta_key='akismet_result' or meta_key='akismet_user' or meta_key='akismet_user_result';

I got 106680. These records accounted most size of the commentmeta table, because each record was large.

My choice

My decision was removing these records and uninstalling Akismet. This is my query:

delete from dbt_commentmeta where meta_key='akismet_as_submitted' or meta_key='akismet_history' or  meta_key='akismet_rechecking' or meta_key='akismet_result' or meta_key='akismet_user' or  meta_key='akismet_user_result';

And after repairing and optimizing table, I got the size of 157 KB. Do you see the difference?

Instead of Akismet, I picked another plugin for anti spamming, which is simple and doesn’t log or write too much in the database: Block Spam By Math Reloaded. Basically this plugin checks spam by force people answer a simple math question. It doesn’t block spam by the comment content, so it can’t blog spam by human. But in my case, that’s good enough. I also modified it a bit to match my design.

It’s not the end

When I write this post, I looked into the code of Akismet, and I find one interesting: Akismet do remove its logs in commentmeta table! It uses WP Cron to run a removal query every day. But for some reason the cron doesn’t run in my blog! I’m still on the way finding the right answer.

15 Comments

  1. Hello,

    I think that problem is outdated. In my case (I am RoR developer) there isn’t any using of tables by akismet ruby library

    Reply
    • I haven’t used Akismet since then. But imagine when the connection to database somehow is broken while Akismet is working (it often happened in my situation because I received a lot of spam everyday), then all the logs are not deleted, and you’ll see the same problem as I did.

      Reply
  2. Akismet puts all my comments from one of my blogs in spam but I am a real commenter who puts hard work into his blog. I love Akismet but I also hate it. :)

    Reply
  3. Thanks ! For me works this query : instead
    select count(*) from dbt_commentmeta …. = select count(*) from wp_commentmeta …..

    Reply
    • Yes, it’s just the table prefix. If you apply my code, you should change to your prefix (you did it).

      Reply
  4. So maybe the problem is that cron is not working due to some server configuration. It would be nice if Akismet could detect this and warn you if it’s logging too much info because it’s functionality is really good.

    Reply
    • Agree. The detection should be integrated to any plugin that logs data (Akismet, Redirection, etc.). That’s why I love simple plugins which don’t log anything.

      Reply
  5. Thank you for the information about how Akismet was actually storing too much on your site and affecting its useability. I am just starting a blog and I’m trying to choose an anti-spam product. While many articles complain about the cost of Aksimet, your article is giving me another more serious issue to consider: am I capable of debugging problems created by Akismet or another spam blocker. This is also the first I’ve heard about using the math question to reduce spam, so I’ll add it to my list of possibilities.
    Thanks!

    Reply
    • Hi Bet, glad that helps you. In my situation, math question is effective! And the plugin is also lightweight. If you want to look to more spam mechanism, you should look at Bad Behavior plugin, it blocks spam by HTTP headers, an interesting different approach.

      Reply
  6. Trần: Glad to hear the math challenge question is helping to block comment spam for your site. Unfortunately, spammers are becoming more sophisticated and site owners with user-generated content need industrial-strength solutions to stop social spam. As sites grow traffic, businesses need to consider technologies offering robust real-time capabilities that block spammers using a multitude of analytic features. For full disclosure: I work for the company providing Disqus with anti-spam solutions.

    Reply
    • Thanks for your comment. Actually, the math question can’t stop all spammers, but in my case it can stop > 95%. It really reduce my server load, since it doesn’t need to analyze comment content. With the by-passed spam comments, I can remove manually.

      Reply
  7. I noticed the same problem on mine too. Don’t get it if using a third party comment system like disqus though. Think I might switch to them.

    Reply

Leave a Reply