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
-
Unsolved I have lost SEO Ranking while removing www from domain
I have lost search SEO ranking for 4-6 core keywords while removing www from domain switch.
On-Page Optimization | | velomate
Referring domain: https://cashforscrapcarsydney.com.au/ Earlier the domain was in the format: https://www.cashforscrapcarsydney.com.au/ But when I checked the search result, search engines had not yet crawled to the new format. Let me know if the server change or any algorithm hit might cause it. Also please share the feedback on - does removing www from the domain losses keyword ranking. Helpful replies are needed.0 -
Comment Links and Pingbacks
I'm updating articles on a large site, some have links in the comments (WP site). The question is: 1. Should I remove the links in the comments, or does Google even care? 2. How do pingbacks affect ranking?
On-Page Optimization | | MichaelGregory0 -
Less Tags better for SEO?
I am currently reviewing my strategy when it comes to categories and tags on my site. Having been no-indexed for some time, and having many tags with just one entry I am thinking that this is not optimal for SEO purposes. This is what I am planning: Categories - Change these to Index, but only after adding a hundred words or so by way of introduction (see this example - https://www.besthostnews.com/news/hosting/a-small-orange-news/). With the categories I am thinking of highlighting key articles as well to improve link juice distribution to older articles that are important. Tags - About half my tags have only 1 entry, with a few more just having 2 entries. I am thinking of deleting all tags with just one entry, and trying to merge those with just two or 3 entries where it makes sense to do so. I will keep these as no-index, but I think this will mean more optimal distribution of link juice within the site. I would appreciate your thoughts \ suggestions on the best practices here.
On-Page Optimization | | TheWebMastercom0 -
HTML Site SEO (NO CMS)
I have got a client site, which is dated (2007) and has not been shifted to any recognised CMS yet. It is HTML based. Is it possible to SEO on such a site? Is it even worth it? If it is possible to do SEO on this, any suggestions will be highly appreciated. Thank you.
On-Page Optimization | | ArthurRadtke3 -
Static pages with dynamic content: Good for SEO?
I wanted to know ones thoughts on reducing duplication by creating a static page with a few dynamic fields. Has anyone done this? If 75% of a page is static and 25% is dynamic, is that a good ratio? It's an idea I am thinking about to combat duplication issues affecting ecommerce pages. Some ecommerce sites generate a new page for a small change like size, but the content is the same. What if you could create a single static page and depending on the size chosen, only those fields connected to the size are dynamic? Everything else remains the same. For caching purposes, you always submit a cached page with default values. Wouldn't this work? Isn't this a solution for duplicate ecommerce pages? It would also help in ranking, rather than multiple external links across duplicate ecommerce pages, it would just be to a single page.
On-Page Optimization | | Bio-RadAbs0 -
Is .PW domain is good for SEO?
I want to register .PW domain which has recently got live to register. I am in doubt should it is good for SEO or not.
On-Page Optimization | | semmediapvtltd0 -
Html code for none .index
In the diagnostic I have several errors in Duplicate Page Content and Title. The thing is that the errors is on the same page but with "different" names. One is called http://siteX.com/ another is called http://www.siteX.com/ and the same third one is called
On-Page Optimization | | mato
http://www.siteX.com/index.html How do I go about changing all three sites, I have changed the /index.html one but dont know how to catch the other once. Is it possible, if it is I would like to know how?0 -
How do you block development servers with robots.txt?
When we create client websites the urls are client.oursite.com. Google is indexing theses sites and attaching to our domain. How can we stop it with robots.txt? I've heard you need to have the robots file on both the main site and the dev sites... A code sample would be groovy. Thanks, TR
On-Page Optimization | | DisMedia0