adding rel="nofollow" to joomla menu item

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
gsadeghi
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sun Aug 28, 2011 9:20 pm

adding rel="nofollow" to joomla menu item

Post by gsadeghi » Fri Jul 20, 2012 1:49 pm

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,

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30879
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

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

Post by Per Yngve Berg » Fri Jul 20, 2012 3:10 pm

Put the links in the robots.txt file.

gsadeghi
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sun Aug 28, 2011 9:20 pm

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

Post by gsadeghi » Fri Jul 20, 2012 3:15 pm

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.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30879
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

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

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


gsadeghi
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sun Aug 28, 2011 9:20 pm

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

Post by gsadeghi » Fri Jul 20, 2012 3:38 pm

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!

mccombinc
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Apr 16, 2013 2:34 pm

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

Post by mccombinc » Tue Apr 16, 2013 2:36 pm

Thanks, gsadeghi. I used your hack but the file I had to change was default_component.php.

innocent101
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Mar 20, 2013 11:31 am

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

Post by innocent101 » Tue Jun 11, 2013 8:53 am

Awesome dude it works for me as well. :laugh:

MediaCore
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Jun 11, 2013 10:11 pm
Location: Auckland, NZ
Contact:

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

Post by MediaCore » Tue Jun 11, 2013 10:22 pm

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.

User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Tue Oct 09, 2012 7:22 am

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

Post by pishro » Tue Oct 01, 2013 4:24 pm

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

egonzalez
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Sep 14, 2014 5:57 pm

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

Post by egonzalez » Sun Sep 14, 2014 6:06 pm

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

User avatar
ladydevil
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sun Sep 14, 2014 5:56 am
Location: Singapore
Contact:

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

Post by ladydevil » Mon Sep 15, 2014 5:32 pm

I think just putting tags: rel = "nofollow".
but I do not see people doing that.?

shoulders
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Fri Oct 10, 2008 9:03 pm
Contact:

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

Post by shoulders » Tue Mar 07, 2017 3:08 pm

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

shoulders
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Fri Oct 10, 2008 9:03 pm
Contact:

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

Post by shoulders » Thu Mar 29, 2018 10:16 am

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

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30879
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

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

Post by Per Yngve Berg » Thu Mar 29, 2018 10:31 am

Not very useful. Bootstrap is not included in joomla 2.5. Check what forum you are posting in.

shoulders
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Fri Oct 10, 2008 9:03 pm
Contact:

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

Post by shoulders » Thu Mar 29, 2018 10:36 am

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


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”