How To Block Referrer Spam Traffic in WordPress

Block referrer spam: This happens almost on all the websites, that suddenly a lot of visitors are rising someday. While they are not real visitors or readers, they are fake traffic in a manner. When we go to google analytics to check traffic of the blog, users appear as some of the referral traffic, And when we do source check, there is a similar source show in the name of a popular website. This type of bot traffic affects our analytics report and also puts additional load on the server. So in this Post, I am going to tell you how we can block spam traffic on our blog.


It is not always that there is a referral spam traffic on your blog, this is sometimes only, but whenever this happens, you have a slight loss. Because, whenever there is a spam traffic on our blog, an analytics report is somewhat distorted somewhere. That means we can not properly analyze the correct traffic report and you will know how much importance google analytics is to make any blog popular. Therefore, when we do not know the real traffic address properly then there is a lot of problem in improving the need of the website according to the requirements of visitors.

What is Spam Traffic or referrer spam Traffic?

If your blog is connected to google analytics and you used to check traffic performance then you would have felt like someday that visitors to your website have doubled or quadrupled or more. And you may feel very happy that I get a lot of users today.

But everything is reversed, because when you check traffic source, you will see a site name in referral traffic in analytics and who do not know, they feel it as real referral visitors.

Because the referral users also come from social media sites such as Facebook, Twitter, Pinterest, but they are real users and when we link our site on any website, there is also a referral traffic which is real. But who comes from a website that does not have any website in real, it is called spam traffic. When we click on that referral source and open it which looks like a website domain, then no site is open because it is a fake source and there is a traffic spam coming out of it.

How to block spam traffic/Referrer spam on your WordPress blog?

Fake traffic on any blog does not have such a problem so much that we need to block it but if you are a WordPress user and have installed your blog on hosting, then spam traffic which is generated from any software bot, Like this fake user uses your hosting server and bandwidth.

This means that they put a heavy load on the server, due to which your website’s loading speed is slowed. And if the referral spam traffic is more then your blog may be down for that time.

Blogs do not have any money on this kind of traffic, but there is a loss. Therefore, we should stop the fake traffic coming to the blog.

If you want to stop fake traffic on your blog, please follow the steps outlined below –

Step – 1

First of all, open your WordPress Dashboard.

  1. Go to Yoast SEO.
  2. Click on Tools.

Step – 2

You will now open a page in which click on the file editor.

Step – 3

Now you have to come down and paste the code below in the .htaccess at the last.

 RewriteEngine On RewriteCond %{HTTP_REFERER} abc\.xyz [NC,OR] RewriteCond %{HTTP_REFERER} brateg\.xyz [NC] RewriteRule .* - [F]

After that, if your blog is experiencing a referral spam traffic from, then write it in the code like abc \ .xyz.

Similarly, if there are too many sources, then RewriteCond% {HTTP_REFERER} brateg \ .xyz [NC] given in the code, copy this line and paste it in the code just before RewriteRule. * – [F] After this, place your referral spam source in place of brateg \ .xyz, just as I said above.

Likewise, coding can prevent multiple fake referral sources from sending spam traffic to your website.

Now save the coding by clicking on the Save changes to htaccess button.

Congratulation ! The sources you blocked now will stop getting spam referral traffic from them. You can still check it out by in your google analytics.

I hope you have learned how to block spam traffic(referrer spam) on the WordPress site, but still, if you have any questions or have any problem in preventing fake traffic, then you can ask by commenting.

In addition to being a computer science engineering student, he is a Passionate blogger and founder of my blogging guide, loves to write about digital marketing, SEO, Blogging related stuff.

Leave a Reply