I have a question about external JavaScript and SEO. Assume I have a site called example.com with and index page of:

  <div class='main-container'>
    <script src='http://www.other.com/page.js'></script>


// at http://www.other.com/page.js
document.write('blue fish and green grass');

Will Google crawl what is outputted by www.other.com/page.js? Are there any techniques or strategies to make that content crawlable so that the text 'blue fish and green grass' was indexed?


This http://moz.com/ugc/can-google-really-access-content-in-javascript-really seems to suggest that it is not but is also somewhat dated.

  • the linked answer is 4 years old and no longer current / relevant
    – timpone
    Feb 9, 2014 at 3:17

2 Answers 2


The best way to identify how google view your page is using fetch as google.

You will then know if the content generated by javascript is crawl by google or not.

In your javascript maybe you can try noscript for the content.

  • interesting results with fetch as google.The exact same Javascript with no surrounding html would show as fetch'd by google whereas javascript + heavy html wouldn't. Seems there's more going on than just the presence or absence of Javascript (perhaps a few hundred milliseconds of checking).
    – timpone
    Apr 22, 2014 at 16:45

Google bot may crawls some content generated by javascript, but it's not reliable and the javascript must be very simple. Although your example is very simple and easy to know the results, looks like external javascripts, even in your own site, won't be crawled.

It's very hard, sometimes impossible, to understand which javascript contents should be read by crawlers. You may print some contents lazily after some event. Some contents may be encoded, concatenated, parsed, etc.

The best way to assure you content will be crawled still is pure html.

This link shows real tests to see what contents google crawls. http://moz.com/ugc/can-google-really-access-content-in-javascript-really

  • thx for the answer but I'd consider that link out of date. I have examples where Google has crawled external Javascript and most people who use Disqus have seen that comments are indexed.
    – timpone
    Feb 9, 2014 at 2:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.