+ Post New Thread
Results 1 to 6 of 6

Thread: How to disallow/ban Google bot to view certain webpage

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,724

    How to disallow/ban Google bot to view certain webpage

    How to disallow Google bot to view a webpage?

    Here is one idea:
    Code:
    <?
    if(strpos($_SERVER['HTTP_USER_AGENT'],'google') !== false ) { header('HTTP/1.0 404 Not Found'); exit(); }
    if(strpos(gethostbyaddr(getenv("REMOTE_ADDR")),'google') !== false ) { header('HTTP/1.0 404 Not Found'); exit(); }
    ?>
    If user agent contains "google", then header 404 (not found) is sent and script is stopped.
    If IP address host contains "google", then same thing happens.

    ---------
    Similar topic, how to hide part of webpage from bots: https://internetlifeforum.com/html-css-forum/1743-how-hide-link-other-part-webpage-bots-like-googlebot/

  2. #2
    Junior Member ELyon01's Avatar
    Join Date
    Jun 2017
    Posts
    5


    Is this useful / helpfull? Yes | No
    Hey there! thanks for that code. Helped a lot.

  3. #3
    Junior Member virtueltime's Avatar
    Join Date
    May 2020
    Location
    Paris
    Posts
    8


    Is this useful / helpfull? Yes | No
    an other way is to add <meta name="googlebot" content="noindex" /> as suggested here developers.google.com/search/reference/robots_meta_tag

  4. #4


    Is this useful / helpfull? Yes | No
    Quote Originally Posted by virtueltime View Post
    an other way is to add <meta name="googlebot" content="noindex" /> as suggested here developers.google.com/search/reference/robots_meta_tag
    I totally agree with this option but if you want to do that with the help of on-page coding then you can add a tag like <meta name="googlebot" content="noindex" /> That will block the request of crawling this page.

  5. #5


    Is this useful / helpfull? Yes | No
    Here are a few examples

    Robots.txt file URL: www.example.com/robots.txt
    Blocking all web crawlers from all content
    User-agent: * Disallow: /

    Blocking a specific web crawler from a specific folder
    User-agent: Googlebot Disallow: /example-subfolder/

  6. #6


    Is this useful / helpfull? Yes | No
    You can disallow Googlebot in robots.txt file. And you can also use this file and mention any other bots.
    You can get more details in robotx.txt file here.

+ Post New Thread

Similar Threads

  1. How much earn per youtube view?
    By shreeharisg in forum Website Monetization
    Replies: 6
    Last Post: 07-23-2019, 03:59 AM
  2. How to Disallow links in google..?
    By ruhikhan in forum SEO - Search Engine Optimisation
    Replies: 2
    Last Post: 07-17-2019, 08:29 AM
  3. How many type of website View..?
    By pihu147741 in forum Introductions
    Replies: 0
    Last Post: 03-13-2018, 05:37 AM
  4. Replies: 0
    Last Post: 09-29-2015, 12:01 PM
  5. Replies: 0
    Last Post: 01-18-2015, 02:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam