Two things I’ve always admired about Roba’s blog are the ajax plugin which adds the comments inline without refreshing the page, and the custom anti-spam words. In the past few months, I’ve tried a dozen different ajax inline-comment plugins and couldn’t get any of them to work with my theme. I’ve been too lazy to try to setup custom anti-spam words until today.
Result:

Walkthrough:
1. Download Peter’s Custom Anti Spam Plugin here.
2. Extract the (peters-custom-anti-spam-image) folder, and upload it under (/wp-content/plugins/)
3. Login to your wordpress dashboard, and click on plugins, and click (Activate) next to (Peter’s Custom Anti-Spam).
4. Clear your browser’s cache, and go to the comments area on any of your blog posts, and check if an anti-spam image is now visible (just above the text area where comments are typed).
5. If it is visible, skip to step 6, otherwise you have to add it manually as follows:
- While logged in to your wordpress dashboard, click on presentation, then click on theme editor
- On the links to the right, click on comments (take a backup of the text before editing it)
- Find the section where the comment form is added, the easiest way is to search for text that appears on the fields above the comments area (like Email Address (*will not be shown).
- Just above the comment field paste the following text (click the image below for an example:
<?php do_action(’secure_image’, $post->ID); ?>
- click (Update File) to save your changes, and again clear the cache, and check the comments area on one of your posts to make sure an anti-spam keyword is now visible
- While logged in to your wordpress dashboard, click on plugins, and then plugin editor
- On the links to the right, click on (Peter’s Custom Anti-Spam)
- Backup the text before editing, and search for: cas_manualinsert
- Change the property from false to true, and click (Update File)
- Skip to step 7
6. While logged in to your wordpress dashboard, click on plugins, and then plugin editor. On the links to the right, click on (Peter’s Custom Anti-Spam). Backup the text before editing.
7. Search for: $cas_text[]
8. Modify each one of the ($cas_text[]) entries by changing the text within the single quotes. These will be your custom anti-spam words. You can also add additional words. I chose to take the names in my blogroll that are 4 characters or less so as not to make it too difficult to type:
$cas_text[] = ‘ABED’;
$cas_text[] = ‘AMAL’;
$cas_text[] = ‘ASMA’;
$cas_text[] = ‘DANA’;
$cas_text[] = ‘MAI’;
$cas_text[] = ‘HALA’;
$cas_text[] = ‘DAVE’;
$cas_text[] = ‘DIMA’;
$cas_text[] = ‘FADI’;
$cas_text[] = ‘HAKI’;
$cas_text[] = ‘JAD’;
$cas_text[] = ‘KJ’;
$cas_text[] = ‘LINA’;
$cas_text[] = ‘MOEY’;
$cas_text[] = ‘MONA’;
$cas_text[] = ‘NAS’;
$cas_text[] = ‘ROBA’;
$cas_text[] = ‘TALA’;
9. Click (Update File)
10. Test the plugin, by logging out, and attempting to comment on one of your posts
Final notes:
- I typed the names in uppercase, but the commenter will be able to type them in lower or upper case.
- There are options within the plugin to change the background, text, and border color of the antispam word image.
- By default only unregistered users are required to enter the anti-spam words.
- There is also an option to play the anti-spam word as an mp3 for the visually impaired.
- You can also upload your own fonts. I decided to only use one font, the clearest of the default ones.
- Free hosted wordpress.com accounts are not allowed to add plugins!
- If your name is longer than 4 characters but you have a nickname like cucu or fufu, let me know and I will gladly use it !
Enjoy!





26 Users Commented In This Post
Posted from
3-2-2008 at 04:53:13
what’s wrong with Akismet ??
Posted from
3-2-2008 at 05:08:33
Xero, Akismet backs up anti-spam images not replaces them, but I will tell you why I find akismet alone is not enough.
Back when I used akismet alone, I ended up with dozens of spam comments caught daily. This is great, but the problem is every once in a while it takes a legitimate comment and sticks it in there, and it’s really hard to find. Wheras if you have custom anti-spam images and akismet, akismet will catch the handful of spam comments that manage to get through the image protection, and if it messes up and flags a genuine comment as spam, it will be easy to find it since there won’t be much else in the spam folder.
Posted from
3-2-2008 at 05:33:26
i wanna comment until i get the “MAI” LOL :D
Posted from
3-2-2008 at 05:34:37
yee i meant **commenting** :)
Posted from
3-2-2008 at 05:35:55
i got DAVE .. eft when is MAI coming??
Posted from
3-2-2008 at 05:37:25
khalas me bedi.. sheklo i’m not gonna get it..
Posted from
3-2-2008 at 05:38:15
YAAAAAAAAAAAAAAAAAAAAAAY!! got it got it :D
yalla bekaffeek today ;) LOL!
Posted from
3-2-2008 at 07:41:26
Maioush, ya3teeki il-3afieh. Sorry Dave was holding things up :D
Posted from
3-2-2008 at 10:42:41
AAAAHAHAHAHHAHAHA!!! HALA!!! HALA!!!! Your antispam word for ur trial was HALA!!!!
Ok that’s it, I’m over it now, someone go tell Nas he’s the antispam word for this morning :D
(REALLY COOOOOOOOOOOOOL!)
Posted from
3-2-2008 at 11:55:03
eish HaaTHa ma fi dima? :S
i like zis :D does it only work on wordpress blogs??
Posted from
3-2-2008 at 15:05:26
181 - Roba
182 - mai
183 - roba
184 - Asma
185 - mai
180 - KJ
179 - HALA
178 - ASMA
177 - JAD
176 - ABED
175 - KJ
174 - JAD
187 - DAVE
….
:)
You have couple of bugs, but the most annoying is the tab-order. You need to fix that
Posted from
3-2-2008 at 20:05:59
Hala I kept hitting CTRL+R until your name came up, I was looking for something with bang(s) :P
ProudPali I didn’t want to reveal your secret identity, or is Dima the superhero ? Added :D
Yeah I’m afraid it doesn’t work on blogspot.
Qwaider You caught my secret algorithm, ladies first and twice as often j/k :D
Funny you should mention this I noticed the tab order thing yesterday, I never even realised there was a tab order on web forms. I guess you learn something new every day! I sent the suggestion to the plugin author among several others.
Posted from
3-3-2008 at 02:22:02
Thanks for the suggestions, Hani. As for the tab order suggestion, try removing the “tabindex” attribute for the anti-spam input field (do a search for “tabindex” in the plugin field).
Posted from
3-3-2008 at 02:34:02
Peter Thank you so much. It’s working now.
Posted from
3-3-2008 at 10:10:55
That’s good, if I switch to wordpress I will be using this! Once our software engineer Qu irons your issues out :D hehe
I will probably be shifting the photo blog to wordpress, I have to iron out the flash stuff first when I ever find the time
Posted from
3-3-2008 at 18:10:45
OMG OMG OMG I got Haki. heheheehe
This is cool Hani :)
Posted from
3-3-2008 at 19:55:31
KJ You’re the only one with a 2 letter nickname!
7aki I wanted to use 7aki but I thought the 7 will be too confusing, besides you’re so famous everyone will still know it’s you :P
Posted from
3-3-2008 at 21:13:32
makes me more special my friend ;) I just feel so loved to watch you and Q do the impossible to keep me off your spam filters!
I must do shampoo commercials
Posted from
3-4-2008 at 02:13:04
Hani
I tried to follow your IQ “Installation Qualification, Huh!” and was hit by the second step, I think you will have to pass it to QA first!
“2. Extract the (peters-custom-anti-spam-image) folder, and upload it under (/wp-content/plugins/)”; Where the hell is that????? Is it some sort of an advanced feature in wordpress “paying money to upgrade my account” ??
I will pass by you first thing in the morning to help me with this, you’re the TS guy!
by the way, is it necessary to cut my name into 4 chars to have the honor to be in your Anti Spam keywords list, if yes what about “WASM”, I will be more than happy to have such an honor
Posted from
3-4-2008 at 07:07:59
Wasim I haven’t a clue if wordpress lets you upload to your free account. I think it must since I see people with wordpress.com accounts use plugins. Of course I can look into this for you, but I charge $150 per hour minimum one hour whether the answer is yes or no, this is incidentally also what it would cost you to get your own hosting for 2 years. So, because I’m you’re friend and want what’s best for you, I recommend you hire me !
So you’re willing to change the name your parents gave you to be an anti-spam custom word?:D
Added!
Posted from
3-4-2008 at 07:36:41
Wasim It seems you can’t add plugins to free wordpress.com hosted accounts:
http://faq.wordpress.com/2006/07/22/where-is-my-plugins-tab/
Posted from
3-11-2008 at 12:54:12
Hey, thanks for the info. Do you have any idea where I can find that custom math problem plugin, where people have to answer a math problem before their comments are displayed? I am getting tired of moderating comments on my blog.
Posted from
3-11-2008 at 19:02:13
Tololy, I haven’t tried either, but here are 2 different plugins that do math antispam:
1. one
2. two
Posted from
3-11-2008 at 21:36:21
Thanks Hani, I downloaded one of the plugins you suggested and it’s working now. BTW, how come I am not on the list of the antispam words you’re using?
*sob*
Posted from
3-12-2008 at 01:05:41
Tololy, I put all the names on my blogroll that are 4 characters or less so as not to torture people in typing long words, would Toly work ?
Posted from
3-12-2008 at 11:29:05
LOL I was kidding, you don’t have to do that ;)
Sharing Is Caring.....