Developer comments in code & SEO
-
A client of mine has provided an SEO report that states:-
"The inclusion of comments by developers in the coe is common practice.....
....its is not positive to leave large blocks of code in the site as makes crawling difficult to crawl"
Im thinking that this has no SEO import at all, any one come across this?
Thanks
z
-
I dont use comments either, i like to see nice easy to read html
-
Developer comments would not survive on one of my sites.
-
Some developers over use comments and can make the file larger and slower, also push content too far down the page.
It can stuff up crawling depending what is in the comments.
I dont believe in minifying code so it can not be easaly read and debuged, but on the other hand you should try to keep code clean as posible, dont use comments if they are not really needed.
-
As a web application developer, I liberally use inline comments (code at the header and inline with code). It's a key to maintaining the code over long periods of time (we forget what we did and why) and across teams (somebody else may need to update code I originally wrote).
That said, I use comments surrounded with tags that do not end up in the HTML code rendered to a visitor. Most languages that "create" HTML code as output (ColdFusion, PHP, etc) usually have tags so comments can be used without being seen in the HTML.
In my opinion, this is the way to go.
Neil, you're probably concerned with the comments in HTML comment tags. I cannot help you there. For those of you who can suggest best practices to site owners and developers, ask that whenever possible inline comments are in tags that **do not show up in final HTML. **
Also, as a practice, I do not want the World seeing (or reverse-engineering) my code based on my comments. Use them as a web developer yet hide comments in output so SEOs do not have headaches of wondering how it affects rankings/page performance.
I hope that helps.
-
Thanks, just a file size issue then. Sorry the image is taken from SEOmoz as an example.
-
The comments you highlighted are actually Internet Explorer conditionals used to give different versions of IE different style sheets. I don't think there's any SEO problem here. (Although I recognise this isn't your site)
Removing them may cause you problems with the layout/style of your site.
-
Comments visible in HTML code do increase the file size, but assuming these blocks of code are of a reasonably normal size, that shouldn't be a problem. Search engines ignore everything that is commented out (mainly because it would make gaming the system so easy).
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Do WooCommerce product tags effect SEO?
I'm just curious if I need these product tags and if they impact in any way at all SEO? - whether that be positively or negatively. on1iRin
On-Page Optimization | | xdunningx0 -
Google AMP or CDN?
Hello. I'm running a CMS that cannot currently support both CDN and Google AMP. I would have to choose one or the other. Does anyone have any insight on which may be the better choice until I can figure out how to have both? I installed CDN first to reduce the time it took for my pages/images to load. I'd like to have AMP because it can do the same, and perhaps be a little more Google friendly (their product). I would appreciate any thoughts. Thanks! Steve
On-Page Optimization | | recoil0 -
Title Tags & Meta descriptions do not update
Hi, I have a question about the title tags and meta descriptions of my domain b-buildingbusiness.com. I've updated them about 5 days ago but the new versions don't show in the search engines. However it does show when you check with the facebook developers tool https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fb-buildingbusiness.com%2F . Does anyone have an idea why they're not updated in the search engines and how I can resolve this? Best, Rik
On-Page Optimization | | bbuildingbusiness0 -
Capitals & Lowercase Titles being seen as different in MOZ
Hi All, Hope you can help. For some reason Moz is pulling up different versions of the same URL as confilicting / duplicate page content. Whats the best way to rectify this or is it something that I should just ignore. /NSW-locations , /NSW-Locations, Nsw-locations Very weird but they are the same page ?!? Cheers Dave
On-Page Optimization | | CFCU0 -
Is my megamenu negatively impacting my SEO?
Hello everyone, I have a megamenu with 87 links in total. We offer a ton of products, so when we decided to have this developed, it seemed like a no-brainer because a straight drop-down menu was really hard to digest. But I have been wondering if it is creating too many links on every single page and/or muddling the signals to the search engines. If anyone could take a look and give me their insight, I would really appreciate it. Thanks, www.cleanedison.com
On-Page Optimization | | CleanEdisonInc0 -
Disqus Comments or IntenseDebate for eCommerce. Can It HELP???
Anybody using any of those? Do you have example of eCommerce store using it? Will it help ranking? Any thing I should know about those ''Comments'' plug-in? Thank you, BigBlaze
On-Page Optimization | | BigBlaze2050 -
Domain registered location - SEO
Hi, I just read if you are targeting a location specific term, it can help SEO if the registered address of the domain is in the same location as the location term your going after. erm, Really?
On-Page Optimization | | activitysuper0 -
Domain Name and On-Page SEO
Where are the best places to put your Domain name in On-Page SEO? My domain name ends in .net so I would like to put it as many places as possible to brand the .net . On the analysis page I have found out that it is not a good idea to put it in the title page...but that is what the SEO guy I hired told me to do. Thanks, Utah Tiger
On-Page Optimization | | Boodreaux0