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
-
How do I hide comment reply's from google? Do I need to?
Reason for asking is Moz reports them as URL too long. Should these even be indexed by google if not, how do I hide them? Example URL : https://www.tansleyphotography.co.uk/farnham-castle-wedding-claire-chris/?reply-to=1876 This really doesn't need indexing, as it's just a comment on a blog post. Does it matter?
On-Page Optimization | | paultansley1 -
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 -
URL Path. What is better for SEO
Hello Moz people, Is it better for SEO to have a URL path like this: flowersite.com/anniversary_flowers/dozen_roses OR flowersite.com/dozen_roses Is it better to have the full trail of pages in the URL?
On-Page Optimization | | CKerr0 -
SEO can id and class be used in H1?
Can ID and class be used in my H1 tag. I realize best case would be to change it, but it's going to require a change order from the ecommerce company to fix their sloppy code. Will this hurt seo? Example:
On-Page Optimization | | K-WINTER0 -
Homepage SEO
Hi I have designed my site with about 10 pages which focus on my main keywords. My question is what should I do about the homepage? Do I focus on a keyword on just my brand name? The homepage is a showcase of all my services and a bit about us. Thanks
On-Page Optimization | | TIG990 -
Page Title in Local SEO Title Tags?
Hi All, Still working on my title tag usage for local SEO, and I was hoping for some more feedback. My question is this: In Local SEO titles, I'm using location + keyword combinations, unique on each page. However, since each page has a specific title for the client, I figure I should be placing that at the front. My thought here was that this helps with the overall usability to the reader of the website. Ex. Contact Us page for Pizza shop Contact Us | Springfield IN Gourmet Pizza | Moe's Italian Pizza Anyone have thoughts on this one? Thank you!
On-Page Optimization | | kbaltzell0 -
Optimization for allready indexed web without seo before
Hi, I have some questions. I have 2 Joomla web sites who needs seo optimization, but there are allready indexed in Google: 1/ Will rel=canonical fix the problem for duplicated content for allready indexed pages? I have read different solutions but I haven't tested them all. I puted rel=canonical on the first web site that I started to optimize, but Google WMT shows me very small or not at all decreasing of duplicated content. Would it need more time? 2/How can I show search engines to craw and change the cache for a page that is allready indexed faster than 1-2 months? 3/ What is your opinion and experience? With done changes for one website for a low competition keyword /the web site was not optimized for search engines before/ how much time will it take usually for Google to see the changes made and change the ranking for some keyword?
On-Page Optimization | | vladokan0 -
Do JSON feed / XML Feeds have any SEO benefits?
We are looking to use a 3rd party customer review provider and I have been told by their rep that it has a feature which allows us to display reviews placed with them about us on our website via JSON feed or XML feed (I have limited technical knowledge so have no idea what this is but am hoping our developer does!) I wanted to ask whether providing data in either format has any SEO benefits? My initial thoughts to provide customer reviews was to be useful to the customer and be useful for search engines as it will be continually updating user generated content (?) Any help on this would be greatly appreciated.
On-Page Optimization | | jannkuzel0