// you’re reading...

Wordpress

Showing Your Akismet Count as Plain Text

Akismet is one of the greatest aids to blogging spam free, ever.

However, showing the spam caught count using the widget uses a blue box with a white background, which, let’s face it, doesn’t fit in with every theme.

As a result, I went scouting through the code, and found that the following can be used to show the count in plain text (I’m sure this is shown elsewhere, but I’m damn well doing it again :P) in the middle of a sentence, like I have in the footer of my blog at the moment. It’s actually really simple.

The following code declares the Akismet code as a variable:
<?php
$count = number_format_i18n(get_option('akismet_spam_count'));
?>

Then, it’s a simple case of doing something like this to show it off:

<a href="http://akismet.com">Akismet</a> has protected my site from <?php echo $count; ?> spam comments. Nice try!

And bam, you have you Akismet readout sat there :) I guess, if you’re doing that, please keep the backlink to Akismet, it’s only fair.. :P

Hope that helps someone.. :)

Discussion

4 comments for “Showing Your Akismet Count as Plain Text”

  1. nice tip! thanks! =)

    Posted by issa | April 11, 2008, 2:16 pm
  2. Works perfectly, thanks. The rotating banner version is just too bulky…text is the way to go.
    ;)

    Posted by BabyGotMac.com | April 13, 2008, 12:47 am
  3. Outstanding upon your suggestion I have replaced the nasty blue button of ick with this and I love it props to you!

    Posted by Big Ben Patton | April 15, 2008, 1:26 pm
  4. Thanks :)
    You should keep the backlink to Akismet on it, though, it’s not fair if you remove it :)

    Posted by George | April 15, 2008, 3:31 pm

Post a comment