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
-
Client Worried About SEO Decline After Site Redesign
Hi, We're in the process of redesigning www.directvillasflorida.com/ for a client. The client has recently expressed concern that their rankings may drop off after the change. Here are some facts about the site: As you can see, the current homepage is _very _keyword heavy. They have a DA of 26 and are ranking #1 for 'florida villas', higher than their more authoritative competitors. They are also ranking #1 in the mobile search results, despite not being mobile-friendly. Their link profile is pretty average and the anchor texts are pretty keyword-rich 'florida villas' appears 30 times with a 4.41% keyword density 'florida' appears 66 times with a 3.31% density The client has admitted keyword stuffing years ago and hasn't changed anything because it worked and still is working. In the site redesign, we've cut out a lot of the spammy, keyword-rich content and he's worried he'll suffer because of this. Any ideas what to do here? It seems clear that the site is breaching Google's guidelines, but, for whatever reason, isn't being picked up by Google. Cheers, Lewis N.B. The client is just paying us for a redesign, not SEO.
On-Page Optimization | | PeaSoupDigital0 -
Does anyone have any experience with Instart Logic, and its effects (if any) on SEO?
Instart Logic is a content delivery network CDN, which claims to have a positive effect on time to first bite (TTFB). Faster site = good for SEO, right? Our initial investigation seems to confirm its claims to some degree, which is great, but at the same time we think it may lower our score on Google's PageSpeed Insights tool, which sort of negates its effect in other areas. If the user experience is worse (according to Google's own tool), are we effectively shooting ourselves in the foot by concentrating on TTFB as a ranking algorithm factor? For reference: https://moz.com/blog/improving-search-rank-by-optimizing-your-time-to-first-byte
On-Page Optimization | | Natalie20120 -
Yoast SEO sitemap link 404 problem
I have recently moved my wordpress blog from a subdomain into a directory e.g. www.mysite.com/blog/ and installed yeast SEO however when I go to the site map as directed in the pluign panel www.mysite.com/blog/sitemap_index.xml its not there are I get a 404 error? Any help much appreciated.
On-Page Optimization | | SamCUK0 -
SEO JOB
I am looking to hire someone who could help me to rank my page better: pediatric-dentist.org. If you are looking for a job and think you might be able to help me out please let me know thanks. I am looking to hire someone ASAP who could start ASAP. Good SEO practice for both of us. Thank you,
On-Page Optimization | | help4561 -
On-page SEO optimization
hi there! Is it possible not to be in the first 20 or 30 positions in the SERPs after executing onpage SEO actions (keyword optimization, metatags, ....) even for keywords for which there's not "too much" competition? Is there a way of visualize the pages indexed by the google bot? (the pages especifically, not the number) in order to discard indexing problems? Thank you!
On-Page Optimization | | juanmiguelcr1 -
Canonical URLs and SEO
After publishing my new wordpress website my on page analysis shows two canonical urls on my homepage. In checking the source code the Yoast SEO plugin states my canoncial url is www.homepage.ca/ This is the only one showing. Having said this I do not add the trailing slash to anything on my url structure. Could this be why the on page analysis tool says there are 2? If so is there any way to resolve this?
On-Page Optimization | | casper4340 -
What Drupal 7 module for SEO, or if not what other SEO software for article writing does anyone recommend?
what Drupal 7 module for SEO article writing optimization, analyzation does anyone recommend? Thanks in advance. We are updating our sites and need this information. If hter is not a Drupal module what else would you recommend?
On-Page Optimization | | alternativelaw0