rel=nofollow on links


Hi all,

I am new to the episerver world and this forum, so I hope that I am going about this the correct way in asking for help/ advice here.

For SEO purposes, I have been asked to add rel=nofollow to certain links in the footer our website. Currently, the footer displays links via the 'page' property (root footer folder is selected) which lists all pages beneth this.

My question, is there any way to implement rel=nofollow on the links that are generated (so in the source it would read <a href="" rel="nofollow">Link text</a> or will I need to create a new property?

Thank you in advance for any help that you can offer.



Jul 16, 2012 15:05

Hi James

Since you're getting the children of a root/container page I would just add a property to those pages that define if you want to hide that page from search engines or not (eg. selected/not selected property). Based on that you can then check if you should add the rel="nofollow" attribute or not.

Hope this helps


Jul 16, 2012 16:39

Hi Frederik,

Thank you for your reply, this makes sense. However, the requirement is to add the rel=nofollow to the link and not the page.

Is it possible to use a checkbox to add the rel=nofollow to any links that are made to the page?



Jul 17, 2012 9:00

When you're saying page do you mean EPiServer page or any URL?


Jul 17, 2012 10:10

All pages would be on episerver.

There is currently a root container called footer which contains the footer pages. The homepage has a property to specify footer links, where you select the footer root container. When this is selected, it automatically shows all pages under the footer root folder.

As these links are automatically generated there is no way from the front end to add the rel="nofollow" tag to the links. Is there some code that can be implemented in the backend to add the rel tag to these auto generated links?


Jul 17, 2012 10:33

Like I said, add a new property to those page types with a selected/not selected property. Then inside your Repeater, PageList or whichever web control you're using to render the list, in the ItemTemplate check if that property is true, if it's add the rel="nofollow" attribute to that link.



Jul 17, 2012 10:40

Hi Frederik,

In theory that solution sounds perfect. I just need to figure out how to code it (as I said i'm new to this).

The masterpage uses a PageList - here is the code: 

<EPiServer:PageList ID="OtherLinks" runat="server" EnableVisibleInMenu="true" SortOrder="Index">
                                <li><EPiServer:Property ID="Property1" PropertyName="PageLink" runat="server" /></li>

Thankyou very much for your help - it is really appreciated. Hopefully I can figure this out!




Jul 17, 2012 14:30

Something like this:

 <%# Container.CurrentPage.HtmlLink() %>

HtmlLink() is an extension method that looks like this:

public static string HtmlLink(this PageData pageData)
	string noFollow = string.Empty;
	if (pageData["NoFollow"] != null && (bool)pageData["NoFollow"])
		noFollow = "rel=\"nofollow\"";
	return string.Format("<a href=\"{0}\" {1}>{2}</a>, pageData.LinkURL, noFollow, pageData.PageName);

This is just to give you an idea.

Good luck



Jul 17, 2012 14:45
Jul 17, 2012 14:53

Hi James,

You should no longer use rel=nofollow as it does not have the affect on Page Rank as it used to. See or another up to date SEO blog for more information.


Jul 17, 2012 16:47

@Alexander, are you sure?

Jul 17, 2012 17:05

Yes I am sure.  You don't pass link juice to the nofollowed links, but you still lose the juice for the page. E.g. if you have 50 regular links and 50 nofollow links, then your page will still only get half the juice that having just 50 regular links and 0 nofollow links would give you. This used to work, but Google changed it a few years back.

Jul 17, 2012 18:26

Hi guys,

Just a quick followup on this topic. I have managed to get the nofollow to work, however the rel="nofollow" appears after the href="" as some links are using the asp:hypserlink property which refrences the URL from an ID (captures when the page loads) so I assume that it puts this as the last property, here is the code:

<asp:HyperLink ID="1" runat="server" CssClass="1" ToolTip="1" Target="_blank" rel="nofollow">1</asp:HyperLink>


 My question is, is it possible to get the rel="nofollow" to appear before the href"" when the page loads?

Jul 24, 2012 16:00

I think it would be a lot of hassle to change the rendering order of asp:HyperLink HTML attributes.

Change it to something where you have full control of the HTML... I don't know what your code does and why but maybe something like:

<a rel="nofollow" href="<%= GetUrl(1)%>" target="_blank">1</a>


Aug 07, 2012 13:38
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.