Preventing Blog Comment spam

*doh* Two days after I install a WordPress plugin for image authentication from Keith McDuffee. I run across this smart fix for stopping wordpress comment spam.

< location /blog/wp-comments-newpost.php >
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^.*dvorak.org/.*
RewriteRule ^.* http://www.ctyme.com/comment-spam.html
< /location >

It makes complete sense, people should only be posting to your blog if they are already on your blog. This should really be part of wordpress IMO. I mean I guess part of blogger API could be (or maybe already is) the ability to comment on posts, so one could post a comment from an rss reader, rather than from a web browser, but I’ve never seen an rss reader which implements this. This kind of restriction is probably just fine.

I checked my wordpress, in my case it is wp-comments-post.php which accepts posts, not -newpost.php like above, and of course I’m not at dvorak.org, but John C. Dvorak is the one getting the word out about the fix from Mark Perkel at
http://www.ctyme.com

I’ll probably get around to installing this in a few days. For now the image auth plugin is working great.

2 thoughts on “Preventing Blog Comment spam”

Comments are closed.