Does Google give any weight to css class or id names?
-
This post is deleted! -
I've never heard of Google using class names as a ranking factor, and I can't see any reason why they would. It would be easy to manipulate, and class names don't affect the user experience at all.
My takeaway from the webmaster guidelines you referenced is that user experience is an important ranking factor (something we knew already), and Google needs to access the page's Javascript and CSS in order to evaluate the user's experience of that page. Google wants to render your page in the same way the user experiences it for indexing purposes. That's why they threaten to penalize your site if you disallow crawling of Javascript or CSS.
-
Class names are part of CSS code, therefore crawlers read the class names.
While 'class names' are not considered in ranking factors specifically, there are other factors that are impacted by them. In addition to issues related to robots.txt files disallowing a crawl of the assets and directly harming how well Google algorithms render/index content, resulting in suboptimal rankings." [c] Here are a few more items to consider:
- External resources like CSS & JavaScript help algorithms understand that the pages are optimized for mobile. And this is a factor in ranking. [b]
- Some JavaScript removes content from the page rather than adding, which prevents Google from indexing the content. This is also a factor in ranking [b]
- Speed is a factor and google publishes a CSS/HTML style guide and best practices for faster loading pages, to optimize the serving of CSS / number of calls. [a] [e]