viewstate question : will it be removed for search engine optimization ?

11 years ago
Hello, I need to make a question before running nopcommerce on production.

I see that every page has a very big VIEWSTATE.

I always avoided this on my sites, doing a pre-render of the HTML and making the VIEWSTATE empty.

I feel that this is a major point for website SEO optimization and indexing.
  
So I am asking : as you stress that NopCommerce ( which is very vell built ) is also
headed to strong SEO... why there is this big VIEWSTATE in every page ?

In your opinion it is not a problem ?

Or it is in your roadmap to be removed, in future versions, just using Session ?


Thank you for any thought and reply.
  
Best Regards
10 years ago
You can also simply relocate the Viewstate beneath the primary SEO targeted content.  You can see this technique implemented on the following page at my former employer:

http://www.footballfanatics.com/NFL_Baltimore_Ravens

Jared Nielsen
www.FUZION.org
10 years ago
Personally I don't think you could take off the ViewState. however you may compress the size of ViewState.


Cheers
Dave
10 years ago
No, you can't delete the ws..
Anyway it will be just skipped from search engines.
10 years ago
Another good reason for an ASP MVC version.

But it's not too hard with the current version to move viewstate to the bottom of the page.

Here's one solution: http://sebnilsson.blogspot.com/2010/03/aspnet-webforms-seo-moving-view-state.html
10 years ago
If you are using nopCommerce in a shard hosting environment, I think you will see better performance from using ViewState to store objects rather than Session because too many objects in Session will take up the server's system resources.  Using ViewState will keep the web server responsive.  If you have many visitors to your website, Session variables can bog down the system.  In my opinion, Session variables should only be used for sensitive data that you do not want to be passed over the line like usernames, emails, passwords, etc.  Another option would be to serialize your objects into your database for storing and retrieving.
10 years ago
How would viewstate ever affect SEO?
10 years ago
SEO is highly competitive. The internet is no longer like the old days when H1 tags and meta keywords gave good search rankings. In today's internet marketing, a person has to take advantage of every little thing they can to keep an edge.

Viewstate populates web pages with a large amount of data that has no meaning other than to the ASP.NET engine.

Search engines rely heavily on the content of web pages to reveal what the website has to offer. Internet marketers have to realize that every trick in the book has already been tried. Search engine developers are not dumb. In many cases, search engines will penalize people for trying to cheat with their SEO. Keyword stuffing is a big one. Stuffing web pages full of keywords can get a website penalized.

Everything a computer does has to be read sequentially. There is no way around it. If you think about it, search engine crawlers that read the web pages of the internet work 24/7, trying to read as much as possible. Now there are more web pages than there are people. How can a search engine keep up?

My point is that with a large amount of Viewstate on the page, a search engine will likely bypass a website littered with Viewstate rather than try and index it in their databases. An online marketer should be aware that content is their most valuable asset. A web developer must take steps to ensure that web crawlers like Google or Bing will have an easy time reading the content of the web pages.
10 years ago
deccks wrote:
SEO is highly competitive. The internet is no longer like the old days when H1 tags and meta keywords gave good search rankings. In today's internet marketing, a person has to take advantage of every little thing they can to keep an edge.

Viewstate populates web pages with a large amount of data that has no meaning other than to the ASP.NET engine.

Search engines rely heavily on the content of web pages to reveal what the website has to offer. Internet marketers have to realize that every trick in the book has already been tried. Search engine developers are not dumb. In many cases, search engines will penalize people for trying to cheat with their SEO. Keyword stuffing is a big one. Stuffing web pages full of keywords can get a website penalized.

Everything a computer does has to be read sequentially. There is no way around it. If you think about it, search engine crawlers that read the web pages of the internet work 24/7, trying to read as much as possible. Now there are more web pages than there are people. How can a search engine keep up?

My point is that with a large amount of Viewstate on the page, a search engine will likely bypass a website littered with Viewstate rather than try and index it in their databases. An online marketer should be aware that content is their most valuable asset. A web developer must take steps to ensure that web crawlers like Google or Bing will have an easy time reading the content of the web pages.


Why don't you just disable it for controls you don't need. I don't think you need viewstate on every page either. Have a look at my website www.just4laptops.co.uk and look at the viewstate. Look at the viewstate of content pages as well like about us or privacy info etc and you can see there is no viewstate at all.
10 years ago
This debate is going in since 2004 and still nobody seems to know if the hidden _viewstate field is effects indexing. I believe for 100% that it is not issue at all. If the _viewstate is very large then you should probably have to worry about other things then SEO.

By now the search engines would probably ignore the _viewstate field and if not all hidden fields inside a page otherwise you would not find any .net page when using Google  and not find any with high page ranking right?

Now type in nop commerce into Google. what do you see? yes all nice and indexed Nop Commerce top ranking #1 position. Hey guess what! it includes viewstate in the top of every page.  

But if you really insist 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