How To Redirect The Spammers Where You Want To?

WordPress is my favorite platform for blogging as well spambots love to target WordPress’ comment script directly by using automatic commenting plugins. The best way to bounce them back or on another page, wherever you want to, is simply by editing your .htaccess file.

Here is the script to add to your WordPress blogs (or into your site’s) .htaccess file:

# block comment spam by denying access to no-referrer requests
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*wparena.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule ^(.*)$ ^http://the-site-where-you-want-to-send-spammers.com/$ [R=301,L]

You need to  change the following lines according to your specific setup:

.wp-comments-post\.php*  = Default for WordPress User

If you are not using WordPress,  add the file name which you are using for comments.

!.*wparena.com.* = Change it with your domain name

^http://the-site-where-you-want-to-send-spammers.com/$

Enter your least favorite website address here. If you want to bounce them back where they are coming from, then simply replace the above line with this:

RewriteRule ^(.*)$ ^http://%{REMOTE_ADDR}/$ [R=301,L]

After setting up these lines of codes in your .htaccess file you immediately eliminate a large portion of blog spam.

Disclosure: Some of the links in this article are affiliate links and we may earn a small commission if you make a purchase, which helps us to keep delivering quality content to you. Here is our disclosure policy.

Noor Mustafa Raza
Noor Mustafa Raza
I am a WordPress Developer and Designer, author @WPArena. I am providing Free WordPress consultation and can help you to install WordPress in a secure way to small businesses and bloggers.

LEAVE A REPLY

Please enter your comment!
Please enter your name here
Captcha verification failed!
CAPTCHA user score failed. Please contact us!

spot_img

Related Articles

How to Reduce WordPress Registration Spam

WordPress forms offer a valuable chance for you to connect with your website visitors and potential customers. Those people may...
Read More
Why WordPress is the best CMS? Having a website has become a necessity for both individuals and businesses. Content Management...
When optimizing the speed of your WordPress site, you might come across a performance metric known as Time to First...