Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SEO Superstitions: Are <script> tags really bad? [closed]

Tags:

seo

We have an SEO team at my office, and one of their dictums is that having lots of <script> blocks inline with the HTML is apocalypticly bad. As a developer that makes no sense to me at all. Surely the Google search engineers, who are the smartest people on the planet, know how to skip over such blocks?
My gut instinct is that minimizing script blocks is a superstition that comes from the early ages of search engine optimizations, and that in today's world it means nothing. Does anyone have any insight on this?


per our SEO guru, script blocks (especially those that are in-line, or occur before actual content) are very, very bad, and make the google bots give up before processing your actual content. Seems like bull to me, but I'd like to see what others say.

like image 316
Danimal Avatar asked Sep 06 '08 22:09

Danimal


2 Answers

It's been ages since I've played the reading google's tea leafs game, but there are a few reasons your SEO expert might be saying this

  1. Three or four years back there was a bit of conventional wisdom floating around that the search engine algorithms would give more weight to search terms that happened sooner in the page. If all other things were equal on Pages A and B, if Page A mentions widgets earlier in the HTML file than Page B, Page A "wins". It's not that Google's engineers and PhD employees couldn't skip over the blocks, it's that they found a valuable metric in their presence. Taking that into account, it's easy to see how unless something "needs" (see #2 below) to be in the head of a document, an SEO obsessed person would want it out.

  2. The SEO people who aren't offering a quick fix tend to be proponents of well-crafted, validating/conforming HTML/XHTML structure. Inline Javascript, particularly the kind web ignorant software engineers tend to favor makes these people (I'm one) seethe. The bias against script tags themselves could also stem from some of the work Yahoo and others have done in optimizing Ajax applications (don't make the browser parse Javascript until is has to). Not necessarily directly related to SEO, but a best practice a white hat SEO type will have picked up.

  3. It's also possible you're misunderstanding each other. Content that's generated by Javascript is considered controversial in the SEO world. It's not that Google can't "see" this content, it's that people are unsure how its presence will rank the page, as a lot of black hat SEO games revolve around hiding and showing content with Javascript.

SEO is at best Kremlinology and at worse a field that the black hats won over a long time ago. My free unsolicited advice is to stay out of the SEO game, present your managers with estimates as so how long it will take to implement their SEO related changes, and leave it at that.

like image 179
Alan Storm Avatar answered Sep 17 '22 23:09

Alan Storm


There's several reasons to avoid inline/internal Javascript:

  • HTML is for structure, not behavior or style. For the same reason you should not put CSS directly in HTML elements, you should not put JS.
  • If your client does not support JS you just pushed a lot of junk. Wasted bandwith.
  • External JS files are cached. That saves some bandwith.
  • You'll have a descentralized javascript. That leads to code repetition and all the known problemns that comes with it.
like image 34
Marcio Aguiar Avatar answered Sep 20 '22 23:09

Marcio Aguiar