
No, I’m not talking about this blog. I’ve installed some nice spam protections on this WordPress blog (anti trackback spams and the comment form with captcha). I’m talking about Menalto Gallery, one of the best Open Source PHP Gallery out there.
I have Gallery installed here on my domain (you can go to my photo gallery through www.cravingtech.com/blog). I remembered posting a link about my Melbourne Zoo photos some weeks ago on an Australian forum, so I was curios to know how many people viewed the album. So yeah, the album got 26,459 hits but also had 66,731 spam comments as a free bonus.
So if you have the PHP Menalto Gallery installed on your site, here are the steps that you need to do to clean and stop the spam for good!
Cleaning current spam comments on Gallery
Note: This mini guide assumes that you understand a bit about SQL queries.
To remove your current spam comments, you need to go to the databae. If your hosting gives you a cPanel, you can usually go to your database using phpMyAdmin. Once there, go to your gallery database (gallery2 by default) and then go to the table called g2_Comment. This is the table that stores all comments in your Gallery.
If you haven’t had real comments before, you can easily empty the table to clean all the junk comments. However, if there were real comments, then it’d be harder.
You can use an SQL query to clean the table. For example, if your last legitimate comment is up to g_id 4475, you can use an SQL Query: “DELETE FROM g2_Comment WHERE g_id > 4475″ as you can see from my screenshot below:

Play around with the SQL queries to filter the real comments with the spam comments.
Installing anti spam comments on Gallery
To prevent more spam comments on your Gallery:
- Install the Captcha plug-in on your Gallery.
Search and download the captcha plug-in through your Gallery’s administration plug-in panel. Activate it and change its default settings:

You can go paranoid and set all of them to High (Captcha must be entered for every guests and users). However, this is not enough. It will eliminate most spams, but unfortunately, some bots who can recognize the captcha images will still spam your Gallery. In this case, you’ll still need to install the second plug-in, called Akismet. - Install Akismet on your Gallery.
To do this, you need to make sure that:
- You have updated your Gallery to the latest version.
- You have updated the Comments plug-in module to the latest verison.
- Enter your Akismet API key on the Comments module settings to activate it. If you haven’t had one, you need to go to Akismet.com to get one. If you have signed up for a Wordpress.com account, you can also use your WordPress.com API key on Gallery.

That’s it! Enjoy a spam-free Gallery!




{ 6 comments… read them below or add one }
I have a blog that has a few thousand spam comments on it. And each day it grows to more. Just a lesson to me to always put some sort of spam protection on a blog even if I don’t expect it to get much traffic. One day I will get in there to clean them out.
Well spam comments are one of the indicators that your blog is getting popular… so think of it in a more positive way
Michael,
I haven’t did much with images on my blog. It did a short test of using them in my posts, but there wasn’t much on an increases of readers using them.
I been looking into posting a graphics library on my site to utilize Google image search. That is a good way to increase some web traffic to a web site.
That’s a good idea too to increase traffic and exposure to your site
Wow that is quite a bit of spam. I know I use AKISMET or whatever the WP plug in is, and I have hundreds of spam per day. One problem I have is that I see some non spam comments integrated within the spam. So lately I have had to strain some comments out of the spam which is a job in itself. A big pain in the butt.
For some reasons nowadays there are more spams coming through to my blog now (they are bypassing my captcha plug-in
) Guess it’s time to move on to find another solution for this. *!*#!$ those spammers!