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 carry out a redirect? Is there a code I need to use?
How do I carry out a redirect? Is there a code I need to use? Thank you in advance.
On-Page Optimization | | laurentjb0 -
Are Wildcard Subdomain Hurting my SEO?
I have some sites with a lot of categories (category, sub-category, sub-subcategory) and locations (country, state/territory, city). To avoid listing pages really deep in my hierarchy I used wildcard subdomains for the locations, but lately I have been told that might be hurting my overall SEO efforts. I have a lot of URLs like https://city-state-country.example.com on one side of the domain and example.com/category/subcategory/subsubcategory on the other. In the middle you see stuff like city-state-country.example.com/category/subcategory/subsubcategory and everything in between. Would I be better off moving the locations to the right side of the domain name? Then you might find stuff like example.com/country/state/city/category/subcategory/subsubcategory and everything in between. I think I could do the new rewrite rules fairly easily since every country slug is just two characters long.
On-Page Optimization | | PostAlmostAnything0 -
Change SEO focus from homepage to other page on the domain
Hi, we are (were) ranking top 5 with gietvloer-wand.nl by focussing the homepage for a certain keyword. We're trying to change to focus from the homepage to /gietvloeren with more content / information. How to go about this? how to tell Google that /gietvloeren is more relevant / important then than the homepage? Or any experiences how long it will take for Google to see that the page has more information than the homepage? It's a test and any experiences you can share would be great. Thanks!
On-Page Optimization | | Heers0 -
Best .net cms and ecommerce platform for seo?
Hi and thanks for looking. Due to internal constraints we are looking at a .net cms and ecommerce solution, I would have preferred a magento and wordpress solution but we have to work within our constraints. Can anyone share their experiences or thoughts on what cms they would use with seo in mind and what eCommerce platform, again with seo in mind. thanks again for looking and all replies gratefully received.
On-Page Optimization | | Renford_Nelson1 -
What is the best SEO Plug-in for Wordpress?What is the best SEO Plug-in for Wordpress?
I manage a Wordpress site and I am interested to get the community's views on the best SEO plug-ins around? We are looking at using Yoast. Should I be looking at anything else?
On-Page Optimization | | cbarron0 -
Best wordpress theme seo 2014
In your opinion what are the best wordpress theme in 2014 that are responsive, good speed and seo buildup
On-Page Optimization | | maestrosonrisas0 -
Are sliding text SEO friendly?
Hi mozzers, I am wondering if sliding text SEO friendly such as this webpage: http://www.questexchange.org/?s=faq If it isn't is there a way to make it SEO Friendly? Thank you!
On-Page Optimization | | Ideas-Money-Art1 -
Does Code Order Matter?
I read/was told that it was a good idea to order your HTML to show the most important content first. So, on many sites I had put my global navigation div, for instance, below my main content div. Does this still apply? And does wise use of HTML 5 mean this is no longer necessary (eg use of "nav" section tag to indicate this section is about navigation). In the same vein, how does Google know that my sidebar nav is my sidebar nav (which your site seems to say is probably given less weight than top nav), and how does it know my topnav is my top nav? Maybe a daft question, but when someone asked me yesterday I realised I didn't know! (Phew - at last I have asked a short question!).
On-Page Optimization | | PeterMurray0