Dashboard Akismet Hack 0.0.3
Posted by Mark | Filed under WordPress
Akismet is a popular comment, trackback, pingback spam blocker. Originally it was developed for the WordPress blogging platform; it has since been extended to work on a variety of blogging and forums systems. However the only part of it I really care about is the WordPress plugin as it is one of the ways I protect this site from spammers. Akismet works great1 but there is one thing the developers of Akismet have never seen fit to do which drives me bonkers. Which is to say the only place the Akismet plugin shows you how many comments it has in the spam moderation queue is on the spam moderation queue page. And yet they put some stats for Akismet right there on the WordPress dashboard. In ages long past, I cobbled together a small hack to display those moderation numbers, when I upgraded my site to a more current version of WordPress my hack broke.
This morning I finally fixed it. People more clever than myself could make this into a full fledged plugin, but this little hack is good enough for me. To do this:
- Download a copy of the Akismet plugin for WordPress
- Decompress the zip file
- Open the akismet.php file in your favorite text editor2
- In akismet.php, search for “function akismet_stats()”. It should be around line 510.
- In the akismet_stats function, under the line reading
echo '<h3>'.__('Spam').'</h3>';add the following code:
$spam_count = akismet_spam_count();
$link = 'edit-comments.php';
if ($spam_count) :
print "<strong><a href="$link?page=akismet-admin" title="Click here to see the moderation queue">Spam in moderation ($spam_count)</a></strong>\n";
endif; - Save your changes.
- Uploaded your edited copy of akismet.php to http://yourblog.com/wp-content/plugins/akismet/ and then follow the normal instructions for installing/activating the Akismet plugin.
With this small hack in place, when Akismet traps some comment spam in its moderation queue the WordPress dashboard will display a link under the Spam in the Latest Activity box. The link will say “Spam in moderation (x)” where x is the number of items in the spam moderation queue. Since WordPress likes to occasionally mangle the display of code in posts, I’ve created a text file with my changes to the akismet_stats function. You download that file here.
Update 2007-04-22: As to be expected, it didn’t take the spammers long to generate some sample data for me to create a screenshot of my hack. Enjoy!
1 Particularly with the Bad Behavior anti-spam plugin added to it.
2 E.g. Kate
Similar Posts
- WordPress/Akismet Hack 0.0.2
Do you run WP? Do you also have Akismet installed? Would you like a quick reference on the Dashboard ... - Pukka’s Links of the Week
Due to recent crackdowns at the office on Internet access, this is likely to be the last PLotW. Also ... - Dear Mr. S. Bot
Dear Mr. S. Bot, Mr. S. Bot, do you mind if I call you Spam? No? Good. I thought I would take a mome ... - Funny Comment Spam
Even though I run multiple plugins to block comment spam; some still makes it into my moderation que ... - Now-Reading Tweaks v2
Some time back, I tried to make Rob Miller's Now-Reading plugin display who's reading each book on t ...
About Mark McKibben
Mark works as a [REDACTED] for [REDACTED], currently residing in Iowa. CoffeeBear.net is a place for him to blather on about whatever strikes his fancy. He currently spends his "free" time working on a photography project, playing with his cat and attempting to keep his wife happy (not necessarily in that order).
2 Comments
Trackbacks/Pingbacks
Leave a Reply
Recent Comments
Alex: I had this problem on a 1999 Golf V5 however this solution didn't work. I phoned a mechanic, who said this:
1) Turn off ignition
2) Turn key part way but don't start the car. With some combination of wiggling the gearstick and turning the key without starting the engine, you can move the stick.
3) Hold the
olga: Hey Julia....I thought about doing the same thing. Half reg coffee and half plain. I tried it one time the other day and it wasnt so bad. alittle light on the coffee flavor but I can deal with it. Thinking about doing it with other fruit flavors too when necessary. Thx for sharing!
olga: Dee,Beck,Josh
You guys make me feel so much better. I thought I was the only one buying so much Dannon Yogurt (45 - 50) cups. whenever they go on sale for 10/ $6 or 10/ $5 . I'm in there. I go to the store and stock up. Those 45 - 50 cups last me
olga: Betsy & Nan
Coffee Dannon is the BOMB ! ! Luv it. Especially Frozen. . It tastes SOoooooo Good. Sometimes when I look up again I've eaten 4 - .5 cups. By then I feel real happy and SATISIFIED !!!!
Janetxb: Another (former) Dannon coffee yogurt fan here..... until recently. I'd say for about 25 years I had one carton of Dannon coffee yogurt almost every day. I was pretty bummed out when they switched from 8- to 6-oz. cups, but I adjusted. Lately I do this instead: I put 1/2 t















April 21st, 2007 at 11:18 am
I meant to include a screenshot of what the link looks like but at the moment my spam moderation queue is empty. Yeah, Akismet! :D Once I’ve got some spam in there, I’ll try to remember to come back and update this post with a screenshot.