Hide Google’s Cached Label

Have you ever looked at a page in Google’s cache?  Do a search and by the results for each you can see a “Cached” link.

google cache link

If you click on it you’ll see a page like this.

google cache label

You can see at the top that the page has a huge disclaimer on the site that takes a lot away from your page.  Wouldn’t it be nice to hide it?

Well, it’s easy to.  Just put this javascript on the page and you’ll be all set.

<script language=”JavaScript” type=”text/javascript”>
<!–
    var UrlIn = document.URL.split(“//”)[1]; //Get the URL.  Cached URLs only have an IP address.

    if (UrlIn.toLowerCase() == UrlIn.toUpperCase())  //If these are the same.  Then there is an IP address for the URL.  This means we should hide it.
    {
        var table = document.getElementsByTagName(“table”); //Get a variable to the first table.  This is the one we want to hide.
        table[0].style.display = “none”; //Set it’s display to “none” to hide it.
    }
//–>
</script>

This works because the label is the very first table on the cached page.  Also, Google’s cache url is always an IP address.

2 thoughts on “Hide Google’s Cached Label”

  1. Hi there,

    I am a bit of a novice but how do I “put javascript” on the page?

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *


8 × = eight

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>