with Lorelle and Brent VanFossen

Bad Behavior Stats in the WordPress Admin Dashboard

After months with little or no comment spam, I got hit with a bunch. In the newest versions of WordPress, right out of the box, I don’t see the comment spam unless it slides through, and those are very few. I use a plugin by ColdForged called Paged Comments, which allows me to view the comment spam that is caught, and then delete it. This saves space in my database.

When a ton of caught spam came through, I decided I would try more harsh measures, especially after a few managed to slip into the regular comments. WordPress is really good about catching these, but these particular posts “appeared” safe but weren’t. So I decided to go with the popular Bad Behavior Comment Spam Plugin and see if that made a difference.

Indeed, it did. The result was that I saw a huge reduction in comment spam viewed when using the Paged Comments plugin feature for “include spam”. But it also got my curiosity up. What was it catching and how many?

Another search turned up Bad Behavior Stats Plugin, a WordPress plugin that reports on the statistics of Bad Behavior’s actions.

The instructions said to put the tag code in the footer.php of my WordPress Theme to show the statistics of Bad Behavior’s, well, behavior. But I didn’t want it cluttering up my footer. After all, no one really cares about what is going on behind the scenes on my site except me. I write enough about how I use WordPress and create my site ON my site, so this kind of detail is of no interest to anyone but me. The comment spammers don’t care.

I wanted to add this information to the Administration panels in WordPress. After much debate, I went in and added it to the Dashboard panel and it works and looks great. Here’s how.

Open /wp-admin/index.php in your text editor. Towards the top, look for:

<h2><?php _e('Latest Activity'); ?></h2>

Below it (or anywhere you want) add the following:

<h2><?php _e('Latest Activity'); ?>
<!--Adding information about bb stats -->
<?php if (function_exists('bb_block_count')) bb_block_count(); ?>
<!--end-->

Screenshot of WordPress Dashboard displaying statistics of bad behavior pluginSave the file and look at your WordPress Admin Dashboard. It should show something like the image to the right, which states the results of the last seven days of activity by Bad Behavior.

I like having this kind of information in the Administration panels, especially since this is “administrative” information.

While WordPress does an incredible job eliminating nagging comment spam, spammers, and even people who are well-intentioned and just trying to use our site to promote their own (not allowed here, folks), get through the filters. The latter I can deal with quickly with the DELETE button. The rest, well, it’s always a race between comment spammers and defensive plugins and programs. Bad Behavior seems to do the job, though. Great work.

3 Comments

  • WordPress › Error

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.