Close Menu
My SiteMy Site
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
Facebook X (Twitter) Instagram
My SiteMy Site
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
My SiteMy Site
Home»Programming»Reduce spam on your WordPress blog using .htaccess
Programming

Reduce spam on your WordPress blog using .htaccess

Oscar FrankBy Oscar Frank1 Min Read
Share
Facebook Twitter LinkedIn WhatsApp Pinterest Email

When it comes to using wordpress as a blogging platform, you can agree with me that spam is one thing that would piss you off if not treated properly. I recently made a post on the Best Anti Spam Plugins which would help you defeat the war of spammers on your blog.

reduce spam using .htaccess in wordpress

 

 

Here is another approach to defeat spammers using the .htaccess file.

 

 

It would involve you editing your .htacess code as shown below, or simple copy this and paste. Remember to change yourdomain to your domain name.

 

 

 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>

Note: It is recommended that you backup your .htaccess file before performing this casre. It can be reused if something goes wrong.

Hope this WordPress tip was helpful.

blogging Wordpress

Related Posts

Navigating Coding Difficulties; What To Do When You Hit A Snag

February 11, 2022

Common Mistakes Newbie Developers Make and Solutions

March 23, 2021

WordPress Blog Hosting made easy with SeekaHost Blog Hosting Control Panel

December 4, 2020
Add A Comment
Leave A Reply Cancel Reply

Recent Posts
  • 6 Sports Apps You Must Have On Your Phone
  • Valencia Travel Guide: All You Need to Know About This Spanish Gem
  • TikTok Faces Unexpected Ban in Senegal, Sparks Global Curiosity
  • The Apple GPT & Apple’s Chatbot Mysterious Debut
  • Triller Takes on TikTok: Filing for Public Listing
Get Exclusive Tech Insights!
My Site
Facebook X (Twitter) Instagram YouTube
© 2025 Oscarmini Co. Designed by illBytes.

Type above and press Enter to search. Press Esc to cancel.