Welcome to Alledia, the Joomla SEO Experts

Here at Alledia we provide you with advice and extensions to rank your Joomla! sites high in search engines such as Google, Yahoo and MSN.

You can read the most popular Joomla blog, join the Joomla SEO Club, check out our SEO-friendly Joomla template or attend a Joomla training class.

Home / SEO / Adding No Follow to Joomla Menu Links

04

Sep

2008

SEO
Adding No Follow to Joomla Menu Links
Written by Steve Burge   

If you don't want pages to indexed by search engines, it's standard SEO practice to add rel="nofollow" on links to that page. Pages you might not want indexed include "Terms and Conditions", "Privacy Policy" and other pages that contains content you don't want to rank for.

However, inside Joomla core, nofollow is not an option for menu links. At the request of some SEO Club members, and with some smart help from Brian Teeman, we've modified the Joomla menu module to allow no-following of links.

How to Use

  1. Upload the new module
  2. Publish this in place of mod_mainmenu
  3. Whenever you want to use no-follow, simply select "On Click, Open in: New Window in Browser Navigation"

Why a New Module and Not a Patch?

Simple - to make it easier to upgrade. With hack attempts rising lately, its important to upgrade as smoothly and easily as possible.

Doesn't the SEF Patch, sh404SEF etc. do this?

No. They add the no-follow to the metadata of the page being linked to. This actually adds no-follow to the menu link itself. Click here for more details on the differences between no follow, meta no follow and robots.txt.

Downloads

Comments (58)Add Comment
0
Mike P
September 04, 2008

Hi Steve. I've been looking for a good way to do this for some time. Very excited to try out the new module! :-)

Joseph LeBlanc
Joseph LeBlanc
September 04, 2008

This is what I like about Joomla!: scratch your own itch without core modifications.

However, you might want to reword the "Why a New Module and Not a Hack?" section there as you're using the word "hack" in two different senses. Had to think about what you were saying there!

Brian Teeman
Brian Teeman
September 04, 2008

Ideally of course it would have been great to achieve this properly and to actualy install a replacement to the menu creator. maybe in J1.6 it will be possible to replace each individual part (i was going to say component but thats confusing smilies/tongue.gif )in the engine.

For now what I really is the ability to override languages

Steve Burge
Steve Burge
September 04, 2008

Cheers Brian - permissions fixed.

Yep - not being able to change the option to say "no follow" instead of "new window" is a little confusing.

0
Robert Wetzlmayr
September 05, 2008

Useful, thanks. That's a nice capability to hide secondary content like TOS pages or imprints from the search engines. A slight correction: The attribute would be spelled rel="nofollow" (without the blank)

pippo morba
pippo morba
September 05, 2008

Hi, does this module work for Joomfish 2.0RC as well?
anybody tested it?

Steve Burge
Steve Burge
September 05, 2008

Thanks Robert - only two typos in one post? Not bad for me smilies/smiley.gif

Hi Pippo - no, but it should work fine. Its just the default menu module slightly modified.

ILJ
ILJ
September 05, 2008

Ive been looking for this last time but totally forget it
thanks for this Steve.

Pardon my english understand, does this module auto detect when user right click and open in new windows?.

how do i set some of the menus to add no-follow.
my site now its indexing my mainmenu as site desc. damm..

thanks

ILJ
ILJ
September 05, 2008

There is another guide for direct coding.
http://www.vitez-studios.com/d...tems.html smilies/smiley.gif

Steve Burge
Steve Burge
September 05, 2008

Hi ILJ

These modules don't open a new window any more. If you chose the "Open in a New Window", it won't any more. It will just add nofollow.

Ogy Nikolic
Ogy Nikolic
September 06, 2008

Steve, I think this is great if you use this solution for your own site but it seems a bit impractical if you are looking to provide this as a solution to 50 business clients where they may not even have time to have training over this.

I have not tried this but it seems a better option to make JCE Editor Plugin and have it as a completely new icon on the toolbar.

In any case, good work! smilies/smiley.gif


Steve Burge
Steve Burge
September 06, 2008

Hi Ogy

Its easy now to add nofollow to content items - the problem is with menu items which could only use a fixed set of parameters for the link (_blank, _parent etc.)

I agree however that this isn't an great solution for clients. This could easily be made part of the core.

0
Ilan H
September 07, 2008

This is just what I was looking for. up until now what I did was create a manual module, and insert manually the link which I wanted to be no followed.

jmatt alibin
jmatt alibin
September 10, 2008

COOL!
I have been looking for this tool a long time.
http://forum.joomla.org/viewtopic.php?f=466&t=311068
Thank you very very much.

Brian Teeman
Brian Teeman
September 10, 2008

I'm really glad that ou are finding this useful. I'll be honest and didnt really see a need for it when Steve asked me if I could make the module but I guess he was correct (as usual) and there is a real need.

Hopefuly this need will be addressed in a future release of Joomla and you wont need this module anymore.

0
Randy
September 10, 2008

Why doesn't the rel="nofollow" show up in the HTML?

Sean Daily
Sean Daily
September 13, 2008

FYI, for some reason J 1.5.7 didn't recognize the XML module in this ZIP file until I unpacked it and then re-compressed it into a new ZIP file. Not sure if that's just my system or what, but thought I'd mention it.

Thanks for the module!!

0
Eddie
September 16, 2008

i still get the default behavior (new window), and there is no nofollow in the code, just the std new window code. using Joomla 1.0.15 Stable

Steve Burge
Steve Burge
September 16, 2008

Hi Eddie

You've uploaded this module and used it to replace your normal main menu?

Code is at line 118.

0
Eddie
September 16, 2008

nevermind, didnt publish the mod. thank you, this is VERY handy. i wish i could add it to any menu item.

0
Anne H
September 19, 2008

Did I miss an instruction file for the installation? I see a comment reference to changing line 118 but which file. I did publish the module. I gather I should unpublish mod_mainmenu.

Steve Burge
Steve Burge
September 19, 2008

Hi Anne

I added a step #2 to make it clearer:
2) Publish this in place of mod_mainmenu

No code hacks needed if you don't want to.

0
Dana
September 25, 2008

Hello

I'm using J1.5.7. The main menu is displayed by default in my template, using:


No menu is enabled using modules, but the template appears to use mod_mainmenu anyway. Using install/uninstall module back end, the mod_mainmenu is listed as a module and is greyed out. It cannot be made active for deletion, so mod_mainmenu cannot be replaced with mod_nfmainmenu.

What can I do to make this work?

0
Mark.Simpson
September 30, 2008

Many thanks for this Brian and Steve.

Some folk on the NF forums needed to have menu links open with Ninja Shadowbox so I modded your module, simply replacing rel="nofollow" with rel="shadowbox" and it worked great.

There isn't an attach feature here or I would upload it.

Thanks again.
Cheers.

Steve Burge
Steve Burge
September 30, 2008

Thanks Mark

Feel free to upload it to your site and you can then paste a download link in the comments.

0
Peter123
September 30, 2008

I need to use the mod_mainmenu_ml for my joomfish translations.

How can I solf this issue?

0
Mark.Simpson
October 02, 2008

Here's the link to the shadowbox version (refer my earlier comment). Both 1.0 and 1.5 versions are included.
http://ninjaforge.com/media/sh...FIRST.zip

Shadowbox is a free GPL extension
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,4577/Itemid,35/

The only code change was rel="nofollow" to rel="shadowbox". You can always open it up and change it again if you have a different pop-up script (rel="lighbox", rel="modalbox", rel="slimbox" etc)

I can't support it unfortunately, but feel free to hassle Steve and Brian smilies/tongue.gif

0
Mark.Simpson
October 02, 2008

Hi Steve... just letting you know i'm getting an error at the very end of this page:
Warning: preg_match() [function.preg-match]: Unknown modifier '>' in /home/alledia/public_html/index.php on line 538

Obviously don't publish this comment smilies/smiley.gif

Cheers
Mark

Steve Burge
Steve Burge
October 02, 2008

Thanks Mark

That error is the one referred to here:
http://www.alledia.com/blog/ac...so-useful/

0
Mark.Simpson
October 03, 2008

Ahhh ok.

Hmmm... seems jomcomment swallowed my link. Take two:
http://ninjaforge.com/media/sh..._FIRST.zip

0
Alen
October 08, 2008

Hi,
it seems very interesting. After installing this new menu and unpublish old, do I have to create all new links in new menu? Is some way to collect old links? I will try it on this domain www.adriastar.com

0
wowjoomla.com
October 08, 2008

Just done a short write up about this matter in a blog post and linked to this post for others to download.

http://www.wowjoomla.com/WowJoomla-News/2008/10/08/nofollow-link-to-low-value-content.html

what I would be interested in is how to have an option for each and every article/post that can have the rel=nofollow attribute assigned to it if needed. I guess this could only be done as a hack. My interest is since I would be looking at using a footer HTML module to display anchor based text links with rel=nofollow, sure I could do that within the codes and I guess we would develop a module that would do that suitably, but an option for other pages would be a nice option to have.

ILJ
ILJ
October 08, 2008

keep up the good work guys. shadow box menu working good too!

0
bzsolt2
October 15, 2008

fantastic, thanks! can't wait to try it out.

0
InVogue
October 27, 2008

There is another guide for direct coding.
http://www.vitez-studios.com/d...tems.html


Hi ILJ,

Is this method safe? does it affect anything else besides just adding rel=nofollow attributes to the navigation links?

Thanks

0
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
October 30, 2008

Thx very much.
I will use it in my site to see the effect.

http://www.descargarwindows.com

Cindy T.
Cindy T.
October 31, 2008

Hi Steve,

Sorry, but "I added a step #2 to make it clearer:
2) Publish this in place of mod_mainmenu"

...is still not clear to me. I have several modules based on mod_mainmenu. Do I have to re-create them all in mod_nfmainmenu?

and what about articles?

I guess I need to know specifically what "publish" means, and what "in place of" means.

Is there something large and base that I am missing here?

Cindy
-Joomla newbie

Cindy T.
Cindy T.
October 31, 2008

Looking at all the files it replaces, what are the chances that some com/mod or something I have used will get wrecked? Or would I have to have manually, consciously made changes to these files that could be lost?

Having re-built once, I am not keen to do it again. I know you have a restore set of files, but its the "if you've made any changes they will be lost" that worries me.

Cindy

Cindy T.
Cindy T.
October 31, 2008

Whhoops ignore, delete the above post. Little confusion here as I look at different solutions, I referenced the wrong fix.
Cindy

0
zsolt2
November 04, 2008

wow! have been looking for this for a while! and free... you spoil us.

0
Sierra Nevada
November 14, 2008

I use yootheme menu. When I use this module loose all menu funtion from yootheme as javascript.

Does anyone knows how to set up this module and behave exacly as mod_main menu??

I have tried module suffix class and menu class but not works.

thanks

Dani

Patrick McNally
Patrick McNally
December 04, 2008

Hi all =)

I installed the mod-nfmainmenu for 1.0 tonight and its not working. Its not adding nofollow to any of the options I choose as far as the Onclick select box. So I went in and edited the code and made it by pass the switch so it always puts a nofollow no matter what. Still no dice. I tried doing it inside the switch and outside the switch.

I still am using mod_mainmenu for all the other menus except for one. Is this the problem?

Light and Love and Healing to you,
-Patrick Arden McNally

0
khalid S
December 31, 2008

How do you "publish this in place of mod_mainmenu"? all the mod_mainmenu are disabled in my system. I need to choose a location for this new menu. How do I go about doing that?

Steve Burge
Steve Burge
December 31, 2008

Hi Khalid

Does this video help?
http://www.joomla-book.info/tu...-15-module

0
khalid S
January 03, 2009

Hi Steve,

thanks for the response. I am familiar with publishing a module in Joomla. My problem is that all of my mod_menu modules are:
1- disabled
2- and have a left position or user3

when I publish the new module in either position left of user 3 of course, it does not replace my top menu. I am not sure if this is a problem with my template. what is the typical position for a top menu module?

0
Kieran
January 03, 2009

Hey,

I would love to use this module but I am not sure if I can use it due to my site design. I want to test it out on a blog www.searchbrat.com. But you can see I use the mainmenu module for the "Blog Categories" menu on the right. I use a special menu type for the top. This is where I would like to use it (add nofollow to contact / about).

I know its not a big deal for this site but for other sites I am working on, it would be great to get this working.

Thanks

Kieran

Steve Burge
Steve Burge
January 05, 2009

Hi Khalid - can you check to see if your template actually uses a module for the menu? Not all templates do.

Hi Kieran - Look for the module in the User8 position. You should be able to edit or replace that module

0
Harvey Blom
February 04, 2009

Forgot to mention the above code needs to be edited in modules/mod_menu/helper.php

Thank you

0
sunblood
February 06, 2009

Are the instructions for joomla 1.0 also? Can't seem to find "On Click, Open in: New Window in Browser Navigation" when I click the link button?

0
MarkAugusta
February 12, 2009

Hi Steve:

Is it possible to use this nofollow somehow in place of the "top menu" / pill menu on the rhuk_milkyway template in Joomla 1.57? I'm getting killed by google bot indexing useless pages. Thanks in advance.

Steve Burge
Steve Burge
February 12, 2009

Sure - I believe rhuk_milkyway uses the regular Joomla module, right?

You can edit as above.

0
MarkAugusta
February 13, 2009

Steve: After taking a second look, couldn't one just simply add a line in to robots.txt to prevent the robot follow?

With kind regards.

0
Morteza
March 20, 2009

excuse me
i have a problem with shadowbox , when i enable sh404sef ,or use seo in joomla , rel="shadobox" do not work and when i disable sh404sef and remove .htaccess , it work.
how can i resolve it ?

0
funske
April 07, 2009

Open helper.php and change the following line (#347)

$data = ''.$image.$tmp->name.'';


to

$data = ''.$image.$tmp->name.'';


to open link in a new window.

Sean Cook
Sean Cook
April 19, 2009

Thanks everyone for the comments and Steve for this
article! smilies/wink.gif

Rafael Silva
Rafael Silva
May 30, 2009

Thanks for the module. Is working im my domain www.fabricandosites.com.br

Rafael Silva
Fabricando Sites
May 30, 2009

Thanks.
Is working im my domain:
www.fabricandosites.com.br

0
Simon_S
June 18, 2009

Great Module, works perfekt!

Will you offer this for the topnav (e.g. ja_rutile template) as well? I´d really need that!

Greetz,

Simon

Write comment
 
  smaller | bigger
 

busy