/webmasters/community?hl=en
/webmasters/community?hl=en
3/1/14
Original Poster
Google user

COMMENTED JAVASCRIPTS

I've read the FAQs and searched the help center. 
I just wanted to know that does having commented javascripts in a site homepage affect it's SEO or site loading time or anything else in particular related to the site?
Community content may not be verified or up-to-date. Learn more.
Recommended Answer
Was this answer helpful?
How can we improve it?
All Replies (3)
Gaieus
3/1/14
Gaieus
Hi Subina, 

In an ideal world, there is no need for redundant code on a page. If it is commented out, it will not load as javascript but will still boost the overall size of the page which needs to load anyway. Normally commented out code should not affect SEO although these comments are often used for cloaking links (well, javascript is generally not used for this) which can adversely affect SEO if Google crawls those parts at all.
JohnMu
3/1/14
JohnMu
Hi Subina!

Apart from the difference in page size (which is generally minimal, to be honest), having comments in JavaScript or HTML has absolutely no effect on how Google views your site: we completely ignore it. Feel free to put or leave whatever you want into your comments (as long as we're not talking of megabytes of comments in each page). 

It may make a difference with regards to load time in the user's browsers though, but again, this really depends on the amount of content that you keep in the comments. For that, I'd recommend reviewing your pages with & without comments in tools like https://developers.google.com/speed/pagespeed/insights/http://www.webpagetest.org/ to see if there is a noticeable difference in your specific case. Sometimes the loading time can be significantly reduced, and sometimes the trade-off of you having to do extra work to get there vs the improvements that users see is worth it, but you really need to check that out for your specific situation, and make that call yourself. 

Cheers
John
3/1/14
Original Poster
Google user
Thank you both!

Regards,
Subina
 
This question is locked and replying has been disabled. Still have questions? Ask the Help Community.

Badges

Some community members might have badges that indicate their identity or level of participation in a community.

 
Google Employee — Google product team members and community managers
 
Community Specialist — Google partners who help ensure the quality of community content
 
Platinum Product Expert — Community members with advanced product knowledge who help other Google users and Product Experts
 
Gold Product Expert — Community members with in-depth product knowledge who help other Google users by answering questions
 
Silver Product Expert — Community members with intermediate product knowledge who help other Google users by answering questions
 
Product Expert Alumni — Former Product Experts who are no longer members of the program
Community content may not be verified or up-to-date. Learn more.

Levels

Member levels indicate a user's level of participation in a forum. The greater the participation, the higher the level. Everyone starts at level 1 and can rise to level 10. These activities can increase your level in a forum:

  • Post an answer.
  • Having your answer selected as the best answer.
  • Having your post rated as helpful.
  • Vote up a post.
  • Correctly mark a topic or post as abuse.

Having a post marked and removed as abuse will slow a user's advance in levels.

View profile in forum?

To view this member's profile, you need to leave the current Help page.

Report abuse in forum?

This comment originated in the Google Product Forum. To report abuse, you need to leave the current Help page.

Reply in forum?

This comment originated in the Google Product Forum. To reply, you need to leave the current Help page.