Custom Anti-Spam Words On Wordpress

March 2nd, 2008
Blogging, Technical

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:

spam free

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); ?>


sample

  • 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!


Tagged ,

26 Users Commented In This Post

Follow-up Comment RSS or leave some TrackBack
270 views | 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Gravatar Icon
Xero said,
Posted from Using Flock Flock 1.0.9 on Windows Windows XP  
3-2-2008 at 04:53:13

what’s wrong with Akismet ??

Gravatar Icon
Hani Obaid said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
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.

Gravatar Icon
Maioush said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
3-2-2008 at 05:33:26

i wanna comment until i get the “MAI” LOL :D

Gravatar Icon
Maioush said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
3-2-2008 at 05:34:37

yee i meant **commenting** :)

Gravatar Icon
Maioush said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
3-2-2008 at 05:35:55

i got DAVE .. eft when is MAI coming??

Gravatar Icon
Maioush said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
3-2-2008 at 05:37:25

khalas me bedi.. sheklo i’m not gonna get it..

Gravatar Icon
Maioush said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
3-2-2008 at 05:38:15

YAAAAAAAAAAAAAAAAAAAAAAY!! got it got it :D
yalla bekaffeek today ;) LOL!

Gravatar Icon
Hani Obaid said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
3-2-2008 at 07:41:26

Maioush, ya3teeki il-3afieh. Sorry Dave was holding things up :D

Gravatar Icon
Hal said,
Posted from Jordan Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Windows Windows XP  
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!)

Gravatar Icon
ProudPali said,
Posted from United States Using Internet Explorer Internet Explorer 6.0 on Windows Windows 2000  
3-2-2008 at 11:55:03

eish HaaTHa ma fi dima? :S

i like zis :D does it only work on wordpress blogs??

Gravatar Icon
Qwaider قويدر said,
Posted from United States Using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista  
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

Gravatar Icon
Hani Obaid said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
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.

Gravatar Icon
Peter said,
Posted from Canada Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Windows Windows XP  
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).

Gravatar Icon
Hani Obaid said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
3-3-2008 at 02:34:02

Peter Thank you so much. It’s working now.

Gravatar Icon
KJ said,
Posted from Finland Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Windows Windows XP  
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

Gravatar Icon
7aki Fadi said,
Posted from Canada Using Internet Explorer Internet Explorer 6.0 on Windows Windows 2000  
3-3-2008 at 18:10:45

OMG OMG OMG I got Haki. heheheehe

This is cool Hani :)

Gravatar Icon
Hani Obaid said,
Posted from Jordan Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
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

Gravatar Icon
KJ said,
Posted from United Arab Emirates Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Windows Windows XP  
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

Gravatar Icon
Wasim said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Windows Windows XP  
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

Gravatar Icon
Hani Obaid said,
Posted from Jordan Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
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!

Gravatar Icon
Hani Obaid said,
Posted from Jordan Using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP  
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/

Gravatar Icon
Tololy said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Ubuntu Linux Ubuntu Linux  
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.

Gravatar Icon
Hani Obaid said,
Posted from Jordan Using Mozilla Mozilla 1.9b5pre on Windows Windows XP  
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

Gravatar Icon
Tololy said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Ubuntu Linux Ubuntu Linux  
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*

Gravatar Icon
Hani Obaid said,
Posted from Jordan Using Mozilla Mozilla 1.9b5pre on Windows Windows XP  
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 ?

Gravatar Icon
Tololy said,
Posted from Using Mozilla Firefox Mozilla Firefox 2.0.0.12 on Ubuntu Linux Ubuntu Linux  
3-12-2008 at 11:29:05

LOL I was kidding, you don’t have to do that ;)

Sharing Is Caring.....

 Name (*Who are you ?)

 Email Address (*private)

 Website (optional)

*
Type the word in the picture
Anti-spam image

 
 
Sharing is caring 1 day, 8 hours ago
  • Hani Obaid : Wohoooo fixed, firebug rocks!
  • Hani Obaid : Damn, how did the theme fonts go bold all by themselves :(
  • BMan : Hi Guys
  • Guest_4882 : thanks
  • Hani Obaid : KJ, That can't be good, did they come back ?!
  • KJ : my eyes are coming out of their sockets
  • Hani Obaid : Heh, hello Stranger, maybe if you picked a nickname :)
  • Guest_4799 : ya 3arab rdo al hi
  • Guest_4799 : hi
  • Hani Obaid : Clears the cobwebs
  • Hani Obaid : Thank you Kuh Jaaay for the heads-up!
  • KJ : HANI HANI OMG OMG OMG OMG OMG DIABLO 3 DID YOU HEAR ME? DIABLO 3!!!! «link»
  • LostWithin : Awwww ...Thank you :D
  • Hani Obaid : LW, Coming right up :)
  • LostWithin : but sth that is not related to FF or IE coz my poor brain can't handle those !
  • LostWithin : Hani dude !! BLOG !! some people want to read !!
  • KJ : ya salam 3a rawaye7 el beit mn warak :P
  • Hani Obaid : KJ, I keep cans of fool, baked beans and such for emergencies ! Yeah and with a certain extensions you can scroll between the tabs using the mouse-wheel. IE can't do that!!
  • KJ : FF3 is so friggin stable! I have over 70 tabs open on deviantart and it didnt even cringe!
  • KJ : Ya Hani ana kteer joo3an w mama nayme shu a3mel bi 7ali!
  • Hani Obaid : You'll get no arguments from me!
  • KJ : firefox 3 is TEH best thing EVA!
  • Hani Obaid : Anna bidi Alienware Area 51 ALX waaaaaa3!
  • KJ : biddi GeForce GTX 280 waaaaaaaaa3
  • KJ : I love being alive too :) you know, often when I get depressed, I just take a deep breath and realize I should be thankful for everything! So yeah, being alive is AWESOME
  • Hani Obaid : I love being alive!
  • KJ : I do, I do.... but you're still the best!
  • Hani Obaid : Then you must not read a lot of blogs Mr. Jarjoos! :)
  • KJ : ever = evah = eva!!! ie ur blog is most awesomest
  • Hani Obaid : KJ, what is an eva ?Being your own god is something else. You're the judge, jury, executioner and the accused all at once!
  • KJ : just voicing my opinion that this is TEH best blog eva! we bow to your divinity! PS: if an atheist believes he/she is the god of something, does this mean they don't believe in themselves :D LOL! jk hehe
  • Hani Obaid : Thanks, I'll give it a shot next time I'm at the DVD store.
 
    
   
   
  Qwaider Planet
  • I can be batman, you can be batman, they can be batmen
  • Two Years later… Yaqubian building
  • Detecting liars and good times!
  • Jelly Belly state of mind [del.icio.us]
  • Weight Loss One Year Later
  • Dubai eGovernment systems are working .. but
  • Apple Stars in Wall-E Movie, a projected subtle product placement by Apple in Pixar’s new movie
  • Losing by way of D/Q
  • Cookie Scandals
  • Shake It, Sakis, One More Time
  • سيارة تتعرف على إشارات المرور
  • Mi Casa Su Casa #3
  • Fetal Position
  • Do Dalí in Bruges
  • The Paradox of Our Time
  • Idol Dilemma?
  • Why Did He Shoot Himself?
  • Boring , Bored and Boredom ...
  • Safira took over!
  • I got Iphone 3G (video)
  • The most unfair thing about life.
  • Muslim World :'(
  • الدم بصيرش مي ( واقع غزاوي )
  • world music nights
  • فطاير بطاطا و بازيلا- Potato and Peas Pies
  • Info2cell Launch SMS and MMS Content Services In Sudan
  • And When Mom Arrived…
  • PhotoHunt 119: What IS That?
  • بنت عيشة... بس سمرا
  • بنت عيشة... بس سمرا
  • Coca Cola Zero | Same Taste… Zero Sugar
  • A Personal Note
  • Latest Updates
  • Tamer Mabrouk arrested
  • ارم ذات العماد
  • الأسبرين .. فوائد ومضار يجب مراعاتها
  • What happens when you don't follow rules..?!?
  • Jihad El-Khazen’s thought of the day about El-Kuntar
  • Monk Metal
  • Blood on sand
  • الكتابة للانترنت والمدونات ( ج 1)
  • Kill them before they kill you
  • Classic ads of Arabia | Abu Al-Sahem Gum
  • Hookers in Amman? Here is your guide...
  • متى تكتمل الصورة؟
  • زوجوها والسبب هي
  • Bacon Rice
  • Islam Expo … my picture
  • Entomophobia
  • My English Creative writing story
  • Is it Better to Live Poor?
  • Name Fusion
  • There is a sucker born every minute
  • The Myth of Economic Growth in Jordan
  • Apprehensive
  • The Box Gets Reviewed
  • Is it only me …
  • Why Do People Like Noor?
  • شيء
  • Where NOT to Wear Reef Beach Sandals
  •  
      Jordanulse.com  
      jordan blogs