Go Back    Forum > Digital Publishing / Web Sites > Website and Server Troubleshooting

LinkBack Thread Tools
07-25-2010, 10:06 PM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
Join Date: Feb 2004
Posts: 4,311
Thanked 376 Times in 342 Posts
You can edit your .htaccess** to prevent spammers posting on your blog.

Most spammers uses bots that lack a referrer. The referrer is the page a person was reading when he/she clicked to leave a comment. Bots didn't click on a link, and therefore lack a proper referrer.

This code will look for the a referrer, and deny comments if the wp-comments-post.php file without directly coming from your blog.

Just change yourblog.com with the URL of your site, using the following code:

RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourblog.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
And that's it.

** Note that Apache (usually Linux) comes with .htaccess abilities, and not Windows IIS servers. If you're using Windows, then you'll need a third-party application that lets you use .htaccess.

- Did my advice help you? Then become a Premium Member and support this site.
- Please Like Us on Facebook | Follow Us on Twitter

- Need a good web host? Ask me for help! Get the shared, VPS, semi-dedicated, cloud, or reseller you need.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Block Windows Media Player's automatic updates kpmedia Computers 2 08-29-2017 12:57 AM
Deleting PM spam easily on vBulletin kpmedia Website and Server Troubleshooting 0 01-25-2010 03:19 PM
List of Useful WordPress 3.x plug-ins [research] admin Website and Server Troubleshooting 1 08-11-2009 12:50 AM
Comments on new Menu? gwors Author, Make Menus, Slideshows, Burn 2 06-05-2005 09:25 PM

Thread Tools

All times are GMT -5. The time now is 04:13 AM