Support » Fixing WordPress » stop spammers using ?

  • Resolved selimkoc


    I have read about how to stop referer spam, and my website is suffering from Tiklasana.Net and (spammers).

    But I want to add a rewrite rule for all those spammers who use ?ref term. I dont have any affiliation or any referer website. So I want to redirect all urls which start with or

    I tried to add url redirects such as

    redirect 301 /?ref=Tiklasana.Net
    redirect 301 /?
    redirect 301 /?ref=Tiklasana.Net%20Arama

    but it did not work. I think question mark and equal characters may have different reprezentations when writing redirect rules.

    I also looked at anti-referer spam plugins, but I think htaccess is easy, because plugings need to modify php files, and you have to do it when you upgrade wordpress.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    What does “?ref=blah” have to do with the referer? What is “referer spam”? What are you trying to do?

    Your question makes no sense whatsoever.

    because plugings need to modify php files

    Who said that? I’ve never seen any antispam plugin that modified my WP files.

    Akismet is my best friend.

    Yes, Akismet works great! Also consider Bad Behavior and a captcha plugin. I use such a combination and no longer have a spam problem. Yes, the spammers still come to my site and try, but thats as far as it goes.

    Good luck!

    google this ref

    what you will see is a spam. so I want to remove this files, even some of them already has a google pagerank.

    if you google you may saw 20 indexed pages, other pages are omitted.

    I dont have a comment spam problem, so I dont need akismet.

    Thanks for you advices

    I have to admit that I’m a bit confused how your situation impacts anything. WP doesn’t recognise the “ref” variable in the URI, so how is the referrer relevant? Why do you think it’s spam? Do you think Google uses the “ref” variable?

    EDIT: Ok, I see what you mean now. Wikipedia explains it pretty well. But how did you find out that Google uses a field called “ref” when indexing and then taking it to represent referrer?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    I’m still not following this, unfortunately. This “ref” is not the referrer. The referrer is part of the http header information. The referrer spam you’re talking about on wikipedia is when a site publishes their referrer logs, so hits to a site with a fake referrer create links on that site. This “ref” does nothing at all.

    That said, the best way to clean up your site in Google is to publish a Google sitemap.

    I am really confused, why you did not understand this problem.

    First of all, I have google sitemap, and I update it regularly. you can see it

    So although my sitemap do not include

    and other three spam urls in google sitemap, or anywhere in my website. Google indexed these pages.

    What is problem is, wordpress shows my index page when you hit these spam urls. So, I think, google thinks that this is content duplication. Because I have one real index page, and 6 spam urls, which shows the same index page.

    What I want to do is remove all this spam urls. And I also want wordpress to show an error page when somebody try to access .

    There is a only one updated plugin for this, but it requires to add some php code to index.php of wordpress and a couple of other installation requirements.

    What I am really asking for is: a rewrite or redirect rule for my htaccess file which will do

    if (someone requests = ) then show file not found error

    and if (someone requests then 301 redirect it to

    I dont know about htaccess files, rewrite rules, but I tried a couple of examples which I found on the net, but they made my website unaccessible. So if there is someone who knows how to write the query for htaccess file which (I think) I explained above, it could be helpfull.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Oh… Well, if all you want to do is that…

    RewriteCond %{THE_REQUEST} \?(ref=.*)?\ HTTP [NC]
    RewriteRule .?{REQUEST_URI}? [R=301,L]

    Why didn’t you say so in the first place? 😉

    This doesn’t discriminate based on what the referrer actually is, like you suggested above though. It just removes the ref variable and sends the 301 redirect to the URL without it. This will have the effect of eliminating these extra results from Google (a 301 redirect is a permanent redirect, and Google will update it’s URL to eliminate the ?ref= stuff), which is what I assume you want.

    I did test this on my own site. It works for me.

    thanks a lot,

    it works also for me.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘stop spammers using ?’ is closed to new replies.