Very *effective* antispam trick on blogs

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:

Some things can vary (like ID of the form), but 90% in cases you won’t need to look for something else ;)

Just AFTER this line you add:

Don't fill this!

We put a form here and hide it. I didn’t use display:none because i wanted to be sure that field will be showed up, even is on the left side of the screen (you should actually turn you head to left to see it :P ) So the bot will actually SEE that form and will fill. Normal user won’t.

Save and upload (or just save if you work directly on ftp) then open wp-comments-post.php from your root folder. Just after the


beginning part, just add this:

if( $_POST['name2']!= ''){
	die('Spammer!');
}

Save and upload.

Next you need to... Hmm... You don't need to do anything else ! Now empty your Akismet queue and wait to see if you get any other spam messages ;)

Note that is possible to not catch ALL spams, but those are automated you won't get it anymore :) Also, when you upgrade wordpress make sure you make those changes again. And finally, BACK UP FIRST!

Update.

READ THIS!

Verry annoying thing that i had recently noticed: even if this small plugin do a great job for spamm *comments*, will NOT work on trackback spam.

E-texteditor 1.0.31 Released

  • Fixed detection of correct syntax for bundle items.
  • Fixed insertion of separators in bundle menus.
  • Fixed cases where deleted bundles returned on restart.
  • Fixed completion within autobrackets.
  • Pageup/down now works in completion popup.
  • Fixed some issues with transformations in snippets.
  • Symbols are now stripped of newlines before transformation.
  • Fixed crash when opening project settings with file selected.
  • Lots of minor bugfixes.

Download free trial of E-texteditor 1.0.31 HERE.

Monday warm up