Most of bloggers have a problem with spam. Of course, there is Akismet, but sometimes Akismet is not good enough because he doesn’t catch all spam messages. So, with this in mind, i wanted only to get rid of all automated messages.
So, look what i did:
First of all, i go with „robots fills ALL fields with something” in my mind. I’ve added only TWO lines of code: one in comments.php from your theme folder and one in wp-comments-post.php from your root folder.
Ok, how you do it?
First of all you need a ftp client and a text editor. E-texteditor is 2 in 1 so you can download a trial version for doing this. Ofcourse, you can use the old and ugly notepad (or whatever your OS has default).
Open comments.php (which is in your wp-content/themes/your_theme_name folder) then find this line:
great code, i will quit to use akismet plugin on my wordpress blog…
Ionut, te iau pe romana, nu prea stiu sa explic pe engleza. Deci am facut exact cum ai spus tu, acuma deschid wp-comments-post.php dar unde adaug aia cu $post die spamer etc. La sfarsit? Multumesc!
Well… Some problems with wp_syntax parse
Fixed now
Ok, thanks. Work’s now! It’s great, I didn’t got any spam messages!
I would’ve done something like header(“Location: someanimalpornurl.com”); instead of the die() line
Great idea, congrats!
Pingback: Usability fail | Staicu Ionut Bogdan
Pingback: Ntz Antispam Plugin | Ionut Staicu - Webdeveloper Blog
Well, there are already some antispam WP plugins working with the same philosophy (http://wordpress.org/extend/plugins/antispam-bee/)
Hi Li-An and thanks for comment. I also did a plugin for this (you can find it HERE).
I didn’t know there is something similar, but, after you take a look in antispam-bee code and then in my code you will see the difference
Pingback: Plugin antispam pentru Wordpress « Cosmin Chiru
I’ve first seen this idea on this blog quite a while ago: http://www.ad7six.com/MiBlog/Spam
I’ve been using it for quite a long time, works great, the only issue is that some form-filling applications automatically fill all fields containing ‘email’ in their name, therefore triggering false positives from time to time.
Pingback: How to: anti-spam eficient in WordPress