The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. Prevent Google from crawling Ajax

    Prevent Google from crawling Ajax

    Intermediate & Advanced SEO
    3 2 1.0k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Shawn_Huber
      Shawn_Huber last edited by

      With Google figuring out how to make Ajax and JS more searchable/indexable, I am curious on thoughts or techniques to prevent this.

      Here's my Situation, we have a page that we do not ever want to be indexed/crawled or other. Currently we have the nofollow/noindex command, but due to technical changes for our site the method in which this information is being implemented if it is ever displayed it will not have the ability to block the content from search. It is also the decision of the business to not list the file in robots.txt due to the sensitivity of the content. Basically, this content doesn't exist unless something super important happens, and even if something super important happens, we do not want Google to know of its existence.

      Since the Dev team is planning on using Ajax/JS to pull in this content if the business turns it on, the concern is that it will be on the homepage and Google could index it. So the questions that I was asked; if Google can/does index, how long would that piece of content potentially appear in the SERPs? Can we block Google from caring about and indexing this section of content on the homepage?

      Sorry for the vagueness of this question, it's very sensitive in nature and I am trying to avoid too many specifics. I am able to discuss this in a more private way if necessary.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • N1ghteyes
        N1ghteyes last edited by

        You may find that you have to wrap the code that gets called when Ajax fires in something to catch the user agent. I.e. if your making an Ajax request to a php script in order to return data, you could wrap that php code in something like this (please excuse the Sudo code):

        if(in_array($_SERVER['HTTP_USER_AGENT'], $knownagents){

        //known webspider, or blocked agent, return nothing.

        return "";

        } else {

        //not a known spider so continue.

        }

        ?>

        Thats very generalised but you get the idea. I put a short list together in JSON format a while back, you can find it here if its of any use: https://www.source-control.co.uk/knownspiders/spiders.php

        PM me if you need any more specific help than that with development, hopefully someone else will have a slightly easier way of dealing with this though heh

        1 Reply Last reply Reply Quote 1
        • Shawn_Huber
          Shawn_Huber last edited by

          Toby, thanks for the suggestion! I believe that this will help accomplish what we need. My Dev gave the "oh S" I should've thought of that response.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Interest in optimise Google Crawl
            Kelly_Edwards
            Kelly_Edwards
            0
            3
            56

          • Google Search Console Crawl Errors?
            Martijn_Scheijbeler
            Martijn_Scheijbeler
            0
            3
            112

          • Can Google Crawl AJAX filters?
            ScottOlson
            ScottOlson
            0
            3
            721

          • How do i prevent Google and Moz from counting pages as duplicates?
            inmn
            inmn
            0
            5
            94

          • Google Webmaster successfully fetched one of my webpages. Does that mean Google will crawl them or readable by bots?
            Gyorgy
            Gyorgy
            0
            2
            72

          • How is Google crawling and indexing this directory listing?
            danatanseo
            danatanseo
            0
            7
            242.6k

          • Significant Google crawl errors
            GregWalt
            GregWalt
            1
            3
            105

          • Stop Google crawling a site at set times
            ske11
            ske11
            0
            5
            164

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy