1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Make links NOFOLLOW with "Meta" Tag or "REL" attribute?

Discussion in 'Black Hat SEO' started by LyNHS, Aug 6, 2010.

  1. LyNHS

    LyNHS Regular Member

    Joined:
    Jul 20, 2010
    Messages:
    282
    Likes Received:
    98
    Occupation:
    Google AdSense
    Home Page:
    Hey everyone!

    Just wondering if there was perhaps a way to automatically change all links posted on a certain page to NOFOLLOW Links...

    I can edit the HTML, but that would be incredibly time consuming. I also have no way of editing the head section!

    So, is there some sort of script that can change all URLs to nofollow without doing the rel="nofollow" attribute or meta name="robots" content="nofollow" tag?

    Thanks!!!! :)
     
  2. Project-Shadow

    Project-Shadow Junior Member

    Joined:
    Mar 9, 2009
    Messages:
    142
    Likes Received:
    159
    If it's a static site then you could do a find and replace on all <a href> tags and re-upload them... aside from that you're pretty much up shit creek as you wouldn't really be able to differenciate between internal and external links and you'd either end up no-following all your links.
     
  3. Panique

    Panique Power Member

    Joined:
    Sep 21, 2008
    Messages:
    589
    Likes Received:
    412
    Location:
    Caribbean Islands
    Home Page:
    If you use macromedia dreamweaver just hit CNTRL + F and use the find and replace function
     
  4. LyNHS

    LyNHS Regular Member

    Joined:
    Jul 20, 2010
    Messages:
    282
    Likes Received:
    98
    Occupation:
    Google AdSense
    Home Page:
    Annoyingly it isn't a static site - I'm trying to learn PHP and have built myself a, unstable at best, Content Management System that uses MySQL.

    I've just create a comments section, but a comment box will appear on about 700 pages, and I'm guessing will be spammed a lot.

    So, if I was to edit the HTML, all I can use is a very basic Text Editor; nothing like Dreamweaver. Also, I only want to make the comments box NOFOLLOW, everything else I want left alone ...

    I guess I'm just going to research and learn a lot more about PHP ... it's just so hard!!!!!

    Thanks for all your input though guys!
     
  5. bartemt

    bartemt Registered Member

    Joined:
    Jun 23, 2010
    Messages:
    81
    Likes Received:
    25
    You need to put this between head tags

    Note that get element by id needs to be your real comment section id (<div id="something">)
    Code:
    <script type="text/javascript">
    
    function nofollows(){
    var a = document.getElementById('something').getElementsByTagName('a');
    
    for (i=0;i<a.length;i++){
    a[i].setAttribute('rel','nofollow');
    }
    
    }
    </script>
    
    And edit your body tag:
    Code:
    <body onload="nofollows();">
    
     
    • Thanks Thanks x 1
  6. LyNHS

    LyNHS Regular Member

    Joined:
    Jul 20, 2010
    Messages:
    282
    Likes Received:
    98
    Occupation:
    Google AdSense
    Home Page:
    Thank you!!! I haven't tried it yet, and am going to try it later tonight ... thanks for the script it's really appreciated! Even though I can't edit anything in the "Head" tags, what I do have already in the "head" tags is a script pointing to an external javascript file ... so Ill just add it in there!

    Thanks again!!!
     
  7. lord

    lord Junior Member

    Joined:
    Jan 21, 2009
    Messages:
    176
    Likes Received:
    251
    use the meta nofollow that's the best way to do that