nofollow tag links and search-engine indexing

Topics: Controls
Jan 6, 2010 at 2:50 PM

Hi All: I'm wondering if there's an easy fix to add "rel=nofollow" to the tag-cloud links (and other "tag" links) that are generated by 1.5.0.7? I was able to modify the permalinks area quite easily, but for the "tag cloud", "tags" & "categories" links (at the bottom of each post), it isn't clear what to do.

The problem is, search engines see these links (running to the hundreds) on every page, and they dilute the search rank because they can be interpreted as link-spamming. They also cause pages to be dropped from indexes because there are too many links to follow.

Currently the tagcloud.cs page has the code below. I'm wondering if there's any way to modify it to add "rel=nofollow"? When I view the page source that's generated, there a "rel=tag" added to every link, but I'm not sure if that has an external purpose? When I run BE1.5 through common SEO validators, they all complain of "too many links" on these pages.

 

    public override void RenderControl(HtmlTextWriter writer)
    {
if (WeightedList.Keys.Count == 0)
{
writer.Write("<p>" + Resources.labels.none + "</p>");
}
      writer.Write("<ul id=\"tagcloud\" class=\"tagcloud\">");
      foreach (string key in WeightedList.Keys)
      {
        writer.Write("<li>");
        writer.Write(string.Format(LINK, Utils.RelativeWebRoot + "?tag=/" + HttpUtility.UrlEncode(key), WeightedList[key], "Tag: " + key, key));
        writer.Write("</li>");
      }
      writer.Write("</ul>");
      writer.Write(Environment.NewLine);
    }
  }
}

    public override void RenderControl(HtmlTextWriter writer)

    {

if (WeightedList.Keys.Count == 0)

{

writer.Write("<p>" + Resources.labels.none + "</p>");

}

 

      writer.Write("<ul id=\"tagcloud\" class=\"tagcloud\">");

      foreach (string key in WeightedList.Keys)

      {

        writer.Write("<li>");

        writer.Write(string.Format(LINK, Utils.RelativeWebRoot + "?tag=/" + HttpUtility.UrlEncode(key), WeightedList[key], "Tag: " + key, key));

        writer.Write("</li>");

      }

 

      writer.Write("</ul>");

      writer.Write(Environment.NewLine);

    }

  }

}

 

 

Coordinator
Jan 6, 2010 at 3:18 PM

In BE 1.5 and later versions, I don't think there is a rel="tag" added to the Tag cloud links.  A typical tag cloud link looks like:

<a title="Tag: blog" href="/?tag=/blog">blog</a>

In widget.ascx.cs, you can modify the LINK to contain rel="nofollow".  It would look like:

private const string LINK = "<a href=\"{0}\" class=\"{1}\" title=\"{2}\" rel=\"nofollow\">{3}</a> ";

Coordinator
Jan 6, 2010 at 3:20 PM

Incidentally, if you're using the Tag Cloud widget, then you would want to modify widget.ascx.cs in the Widgets\Tag Cloud folder.

If you're using the Tag Cloud control <blog:TagCloud>, then you would want to modify the TagCloud.cs file in the App_Code\Controls folder.

Jan 6, 2010 at 4:01 PM
BenAmada wrote:

In BE 1.5 and later versions, I don't think there is a rel="tag" added to the Tag cloud links.  A typical tag cloud link looks like:

<a title="Tag: blog" href="/?tag=/blog">blog</a>

In widget.ascx.cs, you can modify the LINK to contain rel="nofollow".  It would look like:

private const string LINK = "<a href=\"{0}\" class=\"{1}\" title=\"{2}\" rel=\"nofollow\">{3}</a> ";

Thanks...in visual studio, the "private" constants were "hidden" by default and I didn't expand them...I was only looking at the "render control" code! 

This is BE 1.5.0.7, btw...and you are correct about the "rel=tag" not being added to the cloud...but it is added to the tags under the post:

<a href="/xxxxxx/?tag=/guatemala+country" rel="tag">guatemala country</a>,

It would make sense to add it here as well...same for the "categories" links...all of these "followable" links may end up being interpreted as "duplicate content" by SEs...when I use Google's Webmaster Tools to analyze my site, I see that many of these URLs have been indexed, but they all have very low relevance...even for very specific keywords...so I'm concerned that there's duplicate-content penalty being silently imposed here.

Jan 6, 2010 at 5:07 PM
Edited Jan 6, 2010 at 5:11 PM
BenAmada wrote:

Incidentally, if you're using the Tag Cloud widget, then you would want to modify widget.ascx.cs in the Widgets\Tag Cloud folder.

If you're using the Tag Cloud control <blog:TagCloud>, then you would want to modify the TagCloud.cs file in the App_Code\Controls folder.

Never mind...thanks...it is working!

 

 

Jan 6, 2010 at 5:26 PM

I still think this should be a configurable setting, to make it easy to switch.  I think making this as the default is a bad idea.

Google it... you'll see the religious wars.

Jan 6, 2010 at 5:44 PM
ckincincy wrote:

I still think this should be a configurable setting, to make it easy to switch.  I think making this as the default is a bad idea.

Google it... you'll see the religious wars.

I, for one, am aware of the controversy...and my concern stems from the realities of site-indexing, not even SEO directly, although this is an SEO issue. A tremendous number of internal links on every blog page slows indexing considerably, and creates a lot of useless links that I believe (after some empirical testing) also reduces page rank.

Coordinator
Jan 6, 2010 at 6:39 PM

You can remove the rel="tag" if you want.  I found this information on it.

Or, according to this, it looks like you can combine multiple values in the REL attribute ... e.g. rel="tag nofollow".