Entries Tagged as 'googlebot'

Mail Yourself When Google Crawls Your Site php SEo notification

Many web hosting companies are now offering pay per click as well as other marketing methods along with domain names without having the necessary education.

PHP: Mail Yourself When Google Crawls Your Site

Search engines like Google crawls sites from database.Means they have a list of websites in their database for checking and a script suns every specified time to check the listed web sites.You may need sometimes to notify about this event.

Have you ever wanted to know when Google crawls your website? Well now you can using a simple PHP script which emails you every time GoogleBot crawls your site.

I thought that many of you might find this bit of code useful, that is why I have decided to post it up.

It is not a very long piece of code, but I will talk you through how it functions.

First off lets take a look at the code:

  1. <?php
  2. if ( strpos( $_SERVER['HTTP_USER_AGENT'], ‘Googlebot’ ) !== false )
  3. {
  4. // Your email address
  5. $email_address = ‘you@yourdomain.com’;
  6. // Send yourself an email
  7. mail($email_address,’Googlebot Visit Alert’, ‘The Googlebot has visited your page: ‘.$_SERVER['REQUEST_URI'].” at time:”.time());
  8. }
  9. ?>

As you can see it is a simple piece of code.

First of all it checks the user agent to see if it is ‘Googlebot’. If the user agent is ‘Googlebot’ then it will send an email to the email address you supply.