Does inline CSS and JavaScript really affect site SEO?
Asked Answered
D

6

21

Does inline CSS and JavaScript really affect site SEO?

Deterrent answered 10/2, 2010 at 21:28 Comment(2)
@Mods Is this question is On-topic @ stackoverflow?. Even though it was an old question as well as having an accepted answer this question mainly focus on SEO so it should migrate to Pro Webmaster which would be a better fit.Broadside
I'm voting to close this question as off-topic because it is about SEO.Shainashaine
P
15

Hardly. What counts for a search engine is textual content, it will filter out everything else.

I assume CSS comes into play with search engines when they determine whether a portion of text is visible on the page, or hidden for the purposes of SEO. But even there, whether the CSS inline or in a style sheet won't make a difference.

One could argue that the more CSS and JS a page contains, the less weight do search terms have on that page. But I think that argument is invalid, because any non-content content will simply be ignored altogether.

Pedigo answered 10/2, 2010 at 21:33 Comment(3)
yes this is also good article but author nothing mention about bad impact on SEO robertnyman.com/2008/11/20/…Deterrent
this is webdesign.about.com/od/css/a/aa073106.htm also a good article but it's also not saying anything about SEO but 3-4 yrs ago i had read that inline things affects SEODeterrent
The question in mind is the extra DNS lookup (main reason for baked-in styles) and the delay time in CSSOM page render which affects total rendering time, hence taken into account in the total SEO score.Whimsey
W
9

Answered and voted for by true developers.

In-line CSS will contribute to the payload of the page and that affects the load speed. Load speed is one of many ranking factors so it's almost an impossible question to answer conclusively.

The text to code ratio also plays a role. Tons of code to render a few lines of visible text means that search engines need to dig deeper to find the content relevancy in pages. Matt Cutts has alluded to this a few times.

While search engines may ignore comments and in-line css/js the bandwidth, processing and storage logistics may be motivation enough to dampen the SEO performance to some degree on heavy in-line css pages.

Personally I use in-line code only when absolutely page specific scenarios require it and even then I use css compression tools to reduce white space in the documents when ready for production.

I have had this conversation on many occasions and no neither side is conclusive. My simple answer is, if it "could" be detrimental then why risk it.

Warram answered 15/10, 2015 at 21:42 Comment(1)
That is not correct, it takes the SAME time to parse the content since the inline styles are most likely in the document head element and not in the body.. those areas are most likely parsed as separate entities, and it's also not difficult to parse an HTML and throw out the "style" elements, the cost of this is irrelevant since this is done on the Google servers once a page has been cached by a crawlerWhimsey
G
0

I don't think most spiders actually execute Javascript before parsing the page. If there's something you really want indexed, it's best to put it on the page as simple content. Bring it in via Ajax, constructing it on the fly via javascript, et. al, certainly will only hinder its SEO value. Tricky links that take form after being constructed by Javascript are also bad form -- a simple site map probably yields better value.

Greenock answered 10/2, 2010 at 21:40 Comment(0)
T
0

As noted in another answer, any content created or modified by JavaScript is unlikely to be 'seen' by the search engines. Although this of course applies wherever you place the JS.

Depending on the size of your page and the capability of your hosting it could affect indexing. If the extra load is sufficient to start slowing your server's response to page requests then the search engines will slow their spidering and, for a large site, may not manage to crawl the entire site on a timely basis.

Toft answered 12/2, 2010 at 10:9 Comment(2)
correct and more descriptive than the answer chosen. the size is the problem, not the JS/CSS itself.Cyclades
This answer is no longer accurate, as search engines are very capable of reading and understanding javascript.Shinn
R
0

Search Engine mainly read textual part of the website.But there are many factor that include that effects seo. Using table template, and even using inline css make the page load time a little more. even if you can check on html validators it marks all inline ccs as error.Slower responsive time for site.

Recusant answered 10/5, 2014 at 9:38 Comment(0)
O
0

javascript increases the site's load time. I believe that is how it may affect your site's rankings. Head over to https://developers.google.com/speed/pagespeed/insights/ and test your URL. Sometimes using javascript on the first view of your website delays the page load as content is displayed only after the script is rendered. That may hurt user experience and SEO.

Outlandish answered 17/12, 2014 at 5:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.