How to add rel=”nofollow” to the top links in Magento
It is a good practice to add nofollow attribute to the links that are not important from SEO perspective, so link juice is not trickled down to these pages.
These links are on the top of the Magento pages:
My Account | My Wishlist | My Cart | Checkout | Log In
Here is what you have to do:
1. Open the following file:
app/design/frontend/default/[*yourTheme*]/template/page/template/links.phtml
– Replace [*yourTheme*] with whatever the name of your theme is. Replace it with ‘default’ if you are using the default theme.
2. Add rel=”nofollow” to the code on line 37
3. Test your pages
Didn't find what you were looking for? Try these links:
"The only way of finding the limits of the possible is by going beyond them into the impossible." -
Arthur C. Clarke
tony
28 Jul, 2009
I was trying to modify the top.links.phtml file with no success until I found your article. Thanks a Bunch!
MagicCardz
7 Aug, 2009
Youhou!! It works!
Much eseayer than going in all the .xml file.
diego
23 Aug, 2009
This is not good since you are also adding the nofollow to the bottom links (like sitemap).
Do you know how to add the nofollow only to the toplinks?
I can’t find a way to do it
Mike
31 Jan, 2010
I’m a moron. Can you tell me where in this line of code to add it?
<li getIsFirst()): ?> class=”first”getIsLast()): ?> class=”last”getLiParams() ?>>getBeforeText() ?><a href="getUrl() ?>” title=”getTitle() ?>” getAParams() ?>>getLabel() ?>getAfterText() ?>
Moshe Klein
26 Apr, 2010
can you tell me more specific where i would add the no follow
admin
26 Apr, 2010
app/design/frontend/default/[*yourTheme*]/template/page/template/links.phtml
on line 37
nikl
6 May, 2010
It needs to go into the big ‘a’ chunk, anywhere in there just like class, title, etc are defined:
screambuy
13 Oct, 2010
Thanks your post ! i got it too.