The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. White Hat / Black Hat SEO
    4. Deny visitors by referrer in .htaccess to clean up spammy links?

    Deny visitors by referrer in .htaccess to clean up spammy links?

    White Hat / Black Hat SEO
    4 3 1.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • highlyrelevant
      highlyrelevant last edited by

      I want to lead off by saying that I do not recommend trying this. My gut tells me that this is a bad idea, but I want to start a conversation about why.

      Since penguin a few weeks ago, one of the most common topics of conversation in almost every SEO/Webmaster forum is "how to remove spammy links". As Ryan Kent pointed out, it is almost impossible to remove all of these links, as these webmasters and previous link builders rarely respond. This is particularly concerning given that he also points out that Google is very adamant that ALL of these links are removed.

      After a handful of sleepless nights and some research, I found out that you can block traffic from specific referring sites using your.htaccess file. My thinking is that by blocking traffic from the domains with the spammy links, you could prevent Google from crawling from those sites to yours, thus indicating that you do not want to take credit for the link.

      I think there are two parts to the conversation...

      1. Would this work? Google would still see the link on the offending domain, but by blocking that domain are you preventing any strength or penalty associated with that domain from impacting your site?

      2. If for whatever reason this would nto work, would a tweak in the algorithm by Google to allow this practice be beneficial to both Google and the SEO community? This would certainly save those of us tasked with cleaning up previous work by shoddy link builders a lot of time and allow us to focus on what Google wants in creating high quality sites.

      Thoughts?

      1 Reply Last reply Reply Quote 0
      • wrttnwrd
        wrttnwrd last edited by

        Ooooh, that feels all wrong.

        Seems to me .htaccess would block visitors that you may want. And while Google may obey the directive, they may also misinterpret a referrer-specific directive as cloaking.

        If you want to get the same effect, here's what I'd do:

        1. Change the page to which the offending links point. Have it say "This page is gone, but you can get the information you want here" and make that a link to a new page.
        2. Set up your server to return a 410 code when folks visit that page.
        3. Set up a new page with the old page's content, so folks can click from the old to the new, but visiting bots and browsers get a 410 code and dump the page.

        That will get Google to de-index the page in a hurry.

        Another option: Simply add noindex, nofollow to the targeted page.

        But I like the 410 option, because that should break the authority flow and has the best chance of giving Google what it wants, short of removing the link.

        highlyrelevant 1 Reply Last reply Reply Quote 2
        • highlyrelevant
          highlyrelevant @wrttnwrd last edited by

          Hi Ian,

          Thanks for the response. I agree with you that this feels wrong and I don't recommend anyone try this (unless you have a site that you don't mind using as a guinea pig).

          The problem is that, if this is your home page or a strong category page with many legitimate links, rankings, ect., it will be tough to abandon the page altogether.

          To follow up about the original idea, I have done some additional research and found a few mentions, though none of them exceptionally credible, of the fact that the Googlebot does not pass referrer data to the server. Can anyone confirm?

          1 Reply Last reply Reply Quote 0
          • MickEdwards
            MickEdwards last edited by

            I've thought about this idea to get rid of bad links from specific referrers.

            I agree with the comments Ian has made but when it is the homepage it's not always possible to follow those steps.  Has anyone else had any experience/information?

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • New Flurry of thousands of bad links from 3 Spammy websites. Disavow?
              aarongray
              aarongray
              0
              2
              79

            • How to find if a website has paid or spammy back-links? Latest ways to investigate.
              Casey_Bryan
              Casey_Bryan
              0
              2
              76

            • How do I deal with Negative SEO (Spammy Links)?
              MarieHaynes
              MarieHaynes
              0
              3
              188

            • Clean-up Question after a wordpress site Hack added pages with external links from a massive link wheel?
              CandymanKen
              CandymanKen
              0
              4
              214

            • Clear out Spammy Links
              AmandaJ
              AmandaJ
              0
              6
              347

            • Competitors Developing Spammy Link For My Website
              Khem_Raj7
              Khem_Raj7
              0
              6
              517

            • Does anyone have any suggestions on removing spammy links?
              RyanKent
              RyanKent
              3
              72
              17.9k

            • Are there tools out there to determine when a link linked to your site? I want to know when a link farm was done a site.
              firstconversion
              firstconversion
              0
              4
              391

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy