If I go to www.google.com and search for something, are the listings pulled straight from the original HTML (“text-only”) page load, or do the listings also account for (i.e. include) any possible front-end CSS / JavaScript stylings/adjustments?
—
Long version: Consider this basic example and followup questions:
-
If we were a web developer for the Wikipedia (first entry listed) and, for some reason, we changed the word “Chicken” on our page to say “Triceratops” using jQuery (within a standard
$(document).ready()
), would that listing still say “Chicken” in the title and excerpt below the title, or would it say “Triceratops”? NOTE: Keep in mind that it is possible to do this within<title>
inside<head>
, or somewhere in<body>
. -
Similarly, what if we were a web developer for same organization and used some CSS
display:none
or:after
trickery to make it say “Triceratops” instead of “Chicken”, what would this listing say? NOTE: This would probably only apply to places inside<body>
since as far as I know, tags like<title>
inside<head>
are not adjustable via CSS (they are text-only, No HTML).
Related: When will my site's CSS affect my search engine ranking?
2
Answers
This Webmaster blog post states that the web crawler now executes Javascript and renders the page with CSS to have results look closer to what a user would experience it as.
Here is some tests on indexing after content injection via JavaScript: http://www.centrical.com/test/google-json-ld-and-javascript-crawling-and-indexing-test.html
Using such technique described in the article you can check if content is indexed in your case.