Welcome to WebmasterWorld Guest from 54.197.116.116

Message Too Old, No Replies

Will Using Anchor Links With The Full URL Cause Problems For googlebot

   
5:15 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Hi there, Everyone:

I have a long page that I would like to use anchor links on so that people can navigate to specific sections of the page quickly.

However, my shopping cart requires that I use the full URL path in the anchor (along with a little javascript. Will that trip up googlebot or hurt my rankings?

Instead of using an anchor tag such as:

<a href="#more_details">


I have to use:

<a href="http://www.mydomain.com/page1.html#more_details" onclick="javascript:window.location.hash='more_details'; return false;">


Is that going to be a problem?

Thanks in advance.

[edited by: tedster at 5:35 pm (utc) on Jan 19, 2012]
[edit reason] turn off automatic linking [/edit]

6:35 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



No it's not a problem. But you don't need the js for this, you could setup the local anchors with the name property so users can navigate into the different page sections.

The reason the <a href="#more_details"> doesn't work as you expect is likely because you set the base tag in the document. So the href="#more_details" will point to index.html#more_details and not to the page you're at.
7:52 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member Top Contributors Of The Month



You are overiding the click with javascript so can work like this

<a href="#more_details" onclick="javascript:window.location.hash='more_details'; return false;">
8:34 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



@ enigma1

The reason the <a href="#more_details"> doesn't work as you expect is likely because you set the base tag in the document.


Yes, you are correct. Unfortunately, since this is an ecommerce platform, I can't change the base href tag without causing a lot of collateral damage.

You are overiding the click with javascript so can work like this

<a href="#more_details" onclick="javascript:window.location.hash='more_details'; return false;">


Yes, I am overriding the link for visitors who have javascript turned on.

But for visitors who have javascript turned off, I can't simply use <a href="#more_details"> because it will take the visitor to the home page (instead of the named anchor part of the same page).

So for visitors with javascript turned OFF, I need the full URL to the named anchor.

but just to double check with everyone, having that "self referencing" link with the full URL shouldn't affect my rankings / crawlability, right?
8:42 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't see how it would cause any crawling problems. "Self referencing" links are still pretty common on the web (mostly because of clumsy CMSs I think), and I haven't seen evidence of any issues.
9:00 pm on Jan 19, 2012 (gmt 0)

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Thank you, tedster!

Having the anchor text links will DEFINITELY help visitors to the page.