How do you make Wordpress nofollow?

Discussion in 'HTML & Website Design' started by bob25, Oct 6, 2008.

  1. #1
    How do you make Wordpress external links nofollow?

    Do you need a plugin or can you do it with Wordpress? If so do you know a simple to use plugin?

    Thanks
     
    bob25, Oct 6, 2008 IP
  2. roknrolltkovr

    roknrolltkovr Peon

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    codex.wordpress.org/Nofollow is a good place to learn about making WP links nofollow
     
    roknrolltkovr, Oct 6, 2008 IP
  3. valiik

    valiik Well-Known Member

    Messages:
    190
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    There are a couple of ways to do it, a manual way and the plugin way.

    If you want to use a plugin, there is one for the blogroll: http://wordpress.org/extend/plugins/blogroll-nofollow/. I do not know of one that will nofollow the links in the content though.

    To do it manually you just need to edit 2 pages, usually. index.php and single.php

    Just add a replace function that will replace any instances of "<a href" with "<a rel='nofollow' href".

    $content = get_the_content();
    $content = str_replace("<a href", "<a rel='nofollow' href", "$content")
    echo $content;

    I just found this too that you might be able to use: http://www.biggnuts.com/link-a-dink/. It's a plugin that lets you replace words in your content. I have not tried it my self but you can give this a try.

    Hope this helps.
     
    valiik, Oct 6, 2008 IP
  4. Panzer

    Panzer Active Member

    Messages:
    381
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #4
    When your writing a post and want to make some links nofollow while others follow, add rel="nofollow" to the anchor tag.

    eg. <a href="blah.com" rel="nofollow">Blah.com</a>
     
    Panzer, Oct 6, 2008 IP
  5. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #5
    Thanks for the replies. I'm kinda uneasy messing with the code, maybe I'll try it on a new site, but it sounds like something that'll work. I'm trying to make it sitewide comments and all unless approved.
     
    bob25, Oct 6, 2008 IP