Toll Free: 1-877-695-7388

GTA: (647) 699-2838

Search Engine People
  • SEO
  • SEM
  • CRO
  • Display
  • Blog
  • Why Us
  • Contact
  • Join Our Team
  • Get A Quote

Toll Free: 1-877-695-7388

GTA: (647) 699-2838

Does Google Index My # Anchor Links?

Ruud Hein | March 26th, 2012
Tweet56
Share10
Share
Pin
66 Shares

named-anchor-links

Updated: John Mueller pointed out how HTML5 can be used for AJAX driven sites. See below.

Summary: yes, Google indexes on-page anchors and their on-that-same-page content but no Google doesn't by itself index content that would additionally be retrieved besides what's already on the page.

And no Google essentially doesn't index anchor links.

What Are Anchor Links?

Anchors -- also called named anchors -- are places in a page or document you want to be able to directly link and jump to.

Anchor Links are clickable hyperlinks that lead directly to a named anchor. You can recognize them; at the end of the URL they have a pound/hash sign (#) followed by a name or number (called a fragment identifier. Like so: http://www.w3.org/TR/html401/intro/intro.html#fragment-uri

How Do I Make Named Anchors?

  1. By putting an <a name> link in your page:
    • <a name="section-name"></a>
    • <h1><a name="section-name">My Section</a></h1>
  2. By using an ID attribute for an element on your page:
    • <h1 id="section-name">My Section</h1>
    • <div id="section-name">My Section</div>

    In both cases the name needs to be unique.

    Does Google Index Named Anchors?

    Trick question. Google indexes complete web pages, not parts of web pages. So once it has indexed your page that contains named anchors, it has also automatically indexed your named anchors.

    Since 2009 Google at its own discretion may show a named anchor under a search result snippet if the named anchor is relevant to the search. To have that happen the page should also have some sort of table of content linking to the named anchors.

    Does Google Index Anchor Links?

    No.

    Why not?

    When you click an anchor link your browsers asks the website for the whole document at the URL you just clicked minus everything starting from #:

    • you click: example.com/index.html#explain-this
    • your browsers asks for: example.com/index.html
    • once the server has sent this page your browser will then jump to that specific point in the page

    In other words: the browser never send the part after the # to the server and the server never knows about it.

    The automated "browser" that Google uses acts just like that and asks for the URL without the #

    Does Google Index Dynamic AJAX Content With Anchor Links?

    No.

    If a page pulls in and shows different content depending on the # named anchor links clicked, Google does not see and index that content.

    Why not?

    In the above setup:

    • your browser asks for the complete document from the URL up until the # named anchor
    • it receives this document together with some JavaScript
    • when your browser jumps to the # part of the page the JavaScript is trigger and it -- from inside your browser -- asks the server to send over another piece of content
    • when the new content arrives your browser and the JavaScript piece everything together and make it look like one page

    For most practical purposes you can start from the idea that Googlebot (and other search crawlers) do not execute JavaScript. So because of the way browsers work (see above) Google's crawler cannot asks for the URL including the #: anchors in URLs never leave the browser, are never sent to the server, and if they were the server would have no idea what to do with them.

    In short: the web simply doesn't work like that.

    How Can I Make Dynamic AJAX Anchor Links Crawlable?

    Also in 2009 Google proposed a way to make AJAX content crawlable and indexable.

    The proposal relies on a 3 step process:

    1. Change your dynamic AJAX anchor links from #whatever to #!whatever <--- notice the exclamation mark!
    2. When Google finds a link on the web that goes #!... Google will rewrite that part of the URL to ?_escaped_fragment_= followed by whatever was after your #
    3. It will then request this URL from your server

    Example:

    • Googlebot finds the link example.com/index.html#!explain
    • Google rewrites the URL to example.com/index.html?_escaped_fragment_=explain
    • Google adds that URL to its crawl list and will ask your server for that URL

    Updated: John Mueller points out that HTML5's pushState() makes it possible to build AJAX driven sites using good old-fashioned, regular links.

    Conclusion

    • Google indexes web pages; if those pages contain named anchors they will (also) be found and indexed too
    • If the page contains both named anchors and links on that page to those named anchors, Google may show one or more of those named anchors under a search result snippet if they think it is relevant for the query
    • Google does not index AJAX-powered dynamic content that is accessed via a named anchor URL
    • To make dynamic AJAX-powered URLs available for Google to be indexed they need to:
      1. be written as #! instead of just #
      2. be available on your server at the location ?_escaped_fragment_?=

        OR

      3. use regular links with HTML5's pushState() instead
    Tweet56
    Share10
    Share
    Pin
    66 Shares
    Posted in SEOTagged anchor links, faq, named anchors, SEO

    About the Author: Ruud Hein

    My paid passion at Search Engine People sees me applying my passions and knowledge to a wide array of problems, ones I usually experience as challenges. People who know me know I love coffee.

    Ruud Hein

    Recent Posts

    • Maximizing Your E-Commerce Sales:
      A CRO Audit Guide
    • Movin’ On Up! Why Migrating to Google Analytics 4 (GA4) Should be a Priority
    • A Year in Review: The Digital Marketing Trends That Defined 2021
    • The Basics of Video Marketing
    • Just How Much Do Google Reviews Impact Your SEO Ranking?

    Categories

    • Analytics & ROI Analysis
    • Company News
    • Content
    • Conversion Optimization
    • CRO
    • Display Advertising/RTB
    • Email Marketing
    • En Español
    • En Français
    • Inbound Marketing
    • Lead Nurture & Marketing Automation
    • Local Search
    • Marketing
    • Mobile
    • Partnership Marketing
    • PPC
    • PR
    • SEO
    • Social Media Marketing
    • Web Design

    Additional Posts

    How to Increase Conversions Via Keyword Research : 5 Tips

    March 26th, 2012 | by Kamila

    Twitter Is For Engagement & Other Hippie Crap You Should Be Aware Of

    March 23rd, 2012 | by Ruud Hein
    Getting ciations to aid your local seo campaign

    How To Check Local Rankings And Dominate Local Search

    March 23rd, 2012 | by Wayne Barker

    LET'S TALK

    Need more information or want to get in touch?

    Get in touch!
    • SEO
    • SEM
    • Display
    • Blog
    • Why Us
    • Join Our Team
    • Contact Us
    • Local SEO
    • Small Business SEO
    • Enterprise SEO
    • International SEO

    LOCATION

    1305 Pickering Parkway,
    5th Floor Pickering, L1V 3P2

    PHONE

    Toll Free: 1-877-695-7388
    Greater Toronto Area: (647) 699-2838

    Social

    © Search Engine People Inc. 2023 – Canada’s Top Digital Agency
    © SEP 2023 – A Search Engine People Company | Privacy Policy

    Search Engine People