Page 1 of 1

adding rel="nofollow" to joomla menu item

Posted: Fri Jul 20, 2012 1:49 pm
by gsadeghi
Hi,

I want to add the nofollow attribute to some of the links on my menu items. When i use the default robot option on Joomla menu, it will add the attribute to the meta data of the page but not the link itself. Is it possible to modify the links on menu items and add the rel="nofollow"

I'm using Joomla 2.5

Thanks,

Re: adding rel="nofollow" to joomla menu item

Posted: Fri Jul 20, 2012 3:10 pm
by Per Yngve Berg
Put the links in the robots.txt file.

Re: adding rel="nofollow" to joomla menu item

Posted: Fri Jul 20, 2012 3:15 pm
by gsadeghi
Per Yngve Berg wrote:Put the links in the robots.txt file.
That would completely block the search engine bots and it will hurt optimization. I just want to add the attribute to the link in some pages that i have to balance the number of links that link juice passes through on that page.

Re: adding rel="nofollow" to joomla menu item

Posted: Fri Jul 20, 2012 3:20 pm
by Per Yngve Berg

Re: adding rel="nofollow" to joomla menu item

Posted: Fri Jul 20, 2012 3:38 pm
by gsadeghi
Well this is what i did. It's cheating but it worked. It would be be great if this option can be available on core joomla options. is there any place we can request adding feature?

Here's what it did:

Go modules/mod_menu/tmpl
edit the file default_url.php

Code: Select all

$class = $item->anchor_css ? 'class="'.$item->anchor_css.'" ' : '';
$title = $item->anchor_title ? 'title="'.$item->anchor_title.'" ' : '';
On backend menu manager section under "link Type Option" there are 3 options. "Link Title Attribute",
"Link CSS Style" and "Link Image". i don't use any of them so just edited the 'class="' to 'rel="'
so the code looks like this

Code: Select all

$class = $item->anchor_css ? 'rel="'.$item->anchor_css.'" ' : '';
$title = $item->anchor_title ? 'title="'.$item->anchor_title.'" ' : '';
now if you put nofollow on the Link CSS Style the link will get nofollow attribute! As i said, it's cheating but it works!

Re: adding rel="nofollow" to joomla menu item

Posted: Tue Apr 16, 2013 2:36 pm
by mccombinc
Thanks, gsadeghi. I used your hack but the file I had to change was default_component.php.

Re: adding rel="nofollow" to joomla menu item

Posted: Tue Jun 11, 2013 8:53 am
by innocent101
Awesome dude it works for me as well. :laugh:

Re: adding rel="nofollow" to joomla menu item

Posted: Tue Jun 11, 2013 10:22 pm
by MediaCore
Google has recently done a big update and started penalising nofollows if you use them too much. What I mean is site sculpting based on keywords, e.g. content siloing using categories etc.

Re: adding rel="nofollow" to joomla menu item

Posted: Tue Oct 01, 2013 4:24 pm
by pishro
MediaCore wrote:Google has recently done a big update and started penalising nofollows if you use them too much. What I mean is site sculpting based on keywords, e.g. content siloing using categories etc.
I agree with MediaCore!
gsadeghi wrote:I want to add the nofollow attribute to some of the links on my menu items.
please see this item Metadata Options > Robots
http://docs.joomla.org/Help25:Menus_Men ... ta_Options

Re: adding rel="nofollow" to joomla menu item

Posted: Sun Sep 14, 2014 6:06 pm
by egonzalez
One workaround is to use "Link Title attribute" in Link Type Options, just put:

" rel="nofollow" "

this "html-injection" allow you to add any other tag to the link without hacking any program. It works to me with v2.5.11

Re: adding rel="nofollow" to joomla menu item

Posted: Mon Sep 15, 2014 5:32 pm
by ladydevil
I think just putting tags: rel = "nofollow".
but I do not see people doing that.?

Re: adding rel="nofollow" to joomla menu item

Posted: Tue Mar 07, 2017 3:08 pm
by shoulders
egonzalez wrote:One workaround is to use "Link Title attribute" in Link Type Options, just put:

" rel="nofollow" "

this "html-injection" allow you to add any other tag to the link without hacking any program. It works to me with v2.5.11
This is an awesome solution. I have used it to make Bootstrap modals launch from a Joomla menu item.

Thanks

Re: adding rel="nofollow" to joomla menu item

Posted: Thu Mar 29, 2018 10:16 am
by shoulders
egonzalez wrote:
This is an awesome solution. I have used it to make Bootstrap modals launch from a Joomla menu item.

Thanks
Can you post an example of your code so i can add it to my notes

https://quantumwarp.com/kb/articles/30- ... extensions

I am glad it helped

Re: adding rel="nofollow" to joomla menu item

Posted: Thu Mar 29, 2018 10:31 am
by Per Yngve Berg
Not very useful. Bootstrap is not included in joomla 2.5. Check what forum you are posting in.

Re: adding rel="nofollow" to joomla menu item

Posted: Thu Mar 29, 2018 10:36 am
by shoulders
Per Yngve Berg wrote:Not very useful. Bootstrap is not included in joomla 2.5. Check what forum you are posting in.
I did.

You should read the post again. egonzalez said he used it for creating bootstrap modals from the joomla menu and I asked him for his code which is related to the thread as a whole and to his post because he used a technique I posted.

And why is it not useful, I think it is, also the related link I gave egonzalez he might find very useful.

Thanks