<p>We have an SEO team at my office, and one of their dictums is that having lots of &lt;script&gt; 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? <br />
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?</p>

<hr>

<p>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.</p>

[{'answer_id': 47920, 'author': 'VolkerK', 'author_id': 4833, 'author_profile': 'https://Stackoverflow.com/users/4833', 'pm_score': 2, 'selected': False, 'text': '<p>I don\'t know about the SEO aspect of this (because I never can tell the mambo jambo from the real deal). But as Douglas Crockford pointed out in one of his javascript webcasts the browser always stops for parsing the script, at each  element. So, if possible, I\'d rather deliver the whole document and enhance the page as late as possible with scripts anyway.\nSomething like</p>\n\n<pre>\n&lt;head>\n    --stylesheets--\n&lt;/head>\n&lt;body>\n  Lorem ipsum dolor\n  ...\n  ...\n  &lt;script src="theFancyStuff.js">&lt;/script>\n&lt;/body></pre>\n'}, {'answer_id': 47998, 'author': 'Alan Storm', 'author_id': 4668, 'author_profile': 'https://Stackoverflow.com/users/4668', 'pm_score': 5, 'selected': True, 'text': '<p>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</p>\n\n<ol>\n<li><p>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.</p></li>\n<li><p>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. </p></li>\n<li><p>It\'s also possible you\'re misunderstanding each other.  <strong>Content</strong> 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.  </p></li>\n</ol>\n\n<p>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.</p>\n'}, {'answer_id': 48007, 'author': 'Brant Bobby', 'author_id': 4160, 'author_profile': 'https://Stackoverflow.com/users/4160', 'pm_score': 1, 'selected': False, 'text': "<p>I've read in a few places that Google's spiders only index the first 100KB of a page. 20KB of JS at the top of your page would mean 20KB of content later on that Google wouldn't see, etc.</p>\n\n<p>Mind you, I have no idea if this fact is still true, but when combine it with the rest of the superstition/rumors/outright quackery you find in the dark underbelly of SEO forums,  it starts to make a strange sort of sense.</p>\n\n<p>This is in addition to the fact that inline JS is a Bad Thing with respect to the separation of presentation, content, and behavior, as mentioned in other answers.</p>\n"}, {'answer_id': 48028, 'author': 'Marcio Aguiar', 'author_id': 4213, 'author_profile': 'https://Stackoverflow.com/users/4213', 'pm_score': 2, 'selected': False, 'text': "<p>There's several reasons to avoid inline/internal Javascript:</p>\n\n<ul>\n<li>HTML is for <strong>structure</strong>, not behavior or style. For the same reason you should not put CSS directly in HTML elements, you should not put JS. </li>\n<li>If your client does not support JS you just pushed a lot of junk. Wasted bandwith.</li>\n<li>External JS files are cached. That saves some bandwith.</li>\n<li>You'll have a <strong>descentralized</strong> javascript. That leads to code repetition and all the known problemns that comes with it.</li>\n</ul>\n"}, {'answer_id': 48080, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Your SEO guru is slightly off the mark, but I understand the concern. This has nothing to do with whether or not the practice is proper, or whether or not a certain number of script tags is looked upon poorly by Google, but everything to do with page weight. Google stops caching after (I think) 150KB. The more inline scripts your page contains, the greater the chance important content will not be indexed because those scripts added too much weight.</p>\n'}, {'answer_id': 48081, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 0, 'selected': False, 'text': "<p>I've spent some time working on search engines (not Google), but have never really done much from an SEO perspective.</p>\n\n<p>Anyway, here are some factors which Google could reasonably use to penalise the page which should be increased by including big blocks of javascript inline.</p>\n\n<ul>\n<li>Overall page size.</li>\n<li>Page download time (a mix of page size and download speed).</li>\n<li>How early in the page the search terms occurred (might ignore script tags, but that's a lot more processing).</li>\n</ul>\n\n<p>Script tags with lots of inline javascript might be interpreted to be bad on their own. If users frequently loaded a lot of pages form the site, they'd find it much faster if the script was in a single shared file.</p>\n"}, {'answer_id': 14243630, 'author': 'Michael Thamm', 'author_id': 1964121, 'author_profile': 'https://Stackoverflow.com/users/1964121', 'pm_score': 0, 'selected': False, 'text': "<p>I would agree with all of the other comments but would add that when a page has more than just\n <code>&lt;p&gt;</code> around the content you are putting your faith in Google to interpret the mark-up correctly and that is always a risky thing to do. Content is king and if Google can't read the content perfectly then it's just another reason for google to not show you the love.</p>\n"}, {'answer_id': 21980464, 'author': 'Swift Computers', 'author_id': 3167778, 'author_profile': 'https://Stackoverflow.com/users/3167778', 'pm_score': 0, 'selected': False, 'text': '<p>Lots of activities in SEO is not recommended by search engine. You can use <code>&lt;script&gt;</code> tag but not excessively. Even Google Analytics snippet code in <code>&lt;script&gt;</code> tag.</p>\n'}, {'answer_id': 26304813, 'author': 'illbzo1', 'author_id': 732598, 'author_profile': 'https://Stackoverflow.com/users/732598', 'pm_score': 0, 'selected': False, 'text': "<p>This is an old question, but still pretty relevant! </p>\n\n<p>In my experience, script tags are bad if they cause your site to load slowly. Site speed actually does have an impact on your appearance in SERPs, but script tags in and of themselves aren't necessarily bad for SEO.</p>\n"}]
['https://Stackoverflow.com/questions/47886', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2757/']