Gravity Global

Further is now part of Gravity Global

Same team. Same culture. New possibilities.

Following a successful 12-month transition period, we’re pleased to announce Further has now rebranded to become Gravity Global – Performance Marketing, part of Gravity Global.

We’re still the same team with the same leadership, offering the same world-class digital marketing services, but now with the power of a global group behind us. This website is no longer receiving updates – for all of the latest news and insights please visit

Blog index

How To Disable .NET Viewstate For Googlebot

Something we’ve been doing for a long time now is hiding .NET Viewstate from search engine crawlers. While .NET Viewstate is needed to maintain the state for users between postbacks, they can be absolutely massive and bloat out your source code.

It’s not uncommon to see .NET Viewstate that are 800, 900 or even over 1,000 characters. You really want to strip out these Viewstate to reduce the size of the page that Googlebot and other crawlers have to go through.

An Easy Solution

There’s a lot of complex solutions online on how to disable Viewstate for crawlers, but here’s a nice simple one. Simply add this code to your master page page load, so it runs for all pages:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If Request.UserAgent.ToLower.Contains(“googlebot”) OrElse Request.Browser.Crawler Then Page.EnableViewState = False
End If
End Sub

N.B. .NET will still show a part of the Viewstate – but it will be truncated usually to around 50 characters, which isn’t going to cause any problems.


Leave a comment

* Required. Your email address will not be published.


  • Brighton Models / 12 years ago

    Very useful tip.

    We've been struggling with that for a while and never thought that such a small piece of code would do the job. Thanks!

  • Carl / 12 years ago

    Was just looking for a simple solution to this! Cheers

  • Mark / 12 years ago

    Hi Paul,

    This technique does not fall under cloaking.

    Cloaking is serving different *content* to users with the aim of deceiving the search engines. Changing the underlying code, has no effect.

    It's no different to changing CSS/layouts based on user-agent.

    Check out Google's page on this:

  • Paul Thethi / 12 years ago

    Be careful using this method as this cloaking.

    Google also spiders your pages using a different ip address & is not called GoogleBot.
    You can be removed from the search engines for this.


Get in touch

Let’s make it happen. Drop us a message to find out how far we can take your business.

Your details will be stored only to allow direct response to your enquiry; they will not be distributed to any other party, or used for marketing purposes


47-49 Colegate
+44(0)1603 878240


69 Wilson Street
+44(0)1603 878240


Clock Barn
Little Baldon, Oxford
OX44 9PU
+44(0)1603 878240

Latest insights