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
-
Yoast SEO doesn't recognize images
Hi, I'm currently adding alt tags to my images but the Yoast SEO plug in in Wordpress states on all my pages “No images appear in this page, consider adding some as appropriate.“ while I do have images on my pages. What could be the problem? Best, Rik
On-Page Optimization | | bbuildingbusiness0 -
Lost SEO contract, new SEO wants us to do the following - can you explain why?
1. Make prokem.co.uk the master domain rather than prokem-corrosion-protection.com 2. Ensure each http URL is 301 redirected to its https counterpart via htaccess rather than in plesk 3. 301 redirect each www.prokem-corrosion-protection.com URL to its co.uk counterpart via htaccess. I can provide a list of pages to redirect as there are a number of duplicate pages that will need removing. It probably makes sense to implement these other changes at the same time: Remove all of the canonical tags currently on the site. Leverage browser caching by following Google’s page speed recommendations - https://developers.google.com/speed/docs/insights/LeverageBrowserCaching Losslessly compress all of the website’s images. Combine and minify the website’s JavaScript
On-Page Optimization | | Simon_VO0 -
SEO and dynamic content
I am working on a project right now and I am looking for some advice on the SEO implications. The site is an e-commerce site and on the category pages it is using an external call to retrieve the products after the page is loaded. How it works is all content on the site is loaded, then after that a js script appends an ID and loads all of the product information. I am unsure how Google will see this, anyone have any insights?
On-Page Optimization | | LesleyPaone0 -
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 -
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 -
N/A For On-page SEO Report
I have 8 errors and 44 warnings last week. Over the week, I corrected broken links, duplicate titles, meta tags, and duplicate page content. Now after it was run again, I'm getting an N/A. Does N/A mean there are NO errors at all on the site? I didn't fix all of the errors and warnings but most I did. My website is also up and running. Please let me know if I'm missing something or if I did that good of a job for my client's on-page SEO stuff, which I doubt despite moving the needle forward. Thanks
On-Page Optimization | | JQC0 -
Are blank Product Review pages bad for SEO?
Hi there, I'm running a new e-commerce site (BoatOutfitters.com) and have a question about our product review pages. On our current campaign, we have a lot of duplicate page content errors. When we export the data, it's almost all blank product review pages (since we are new, we don't have that many product reviews yet). Our product reviews aren't run through javascript, so we originally did not add them to a robots.txt file - however, I'm now wondering if it's worse to have all of these duplicate blank pages, or is it not affecting our SEO at all? Should we just wait until these products have reviews which will benefit our SEO and then they won't be considered "duplicate pages" - right? Sorry if this has been answered before - new here at SEO Moz and just looking for some help. Thanks!
On-Page Optimization | | BoatOutfitters0 -
Blog Comment IPs Seen By Google?
I have a page on a client's site for testimonials (a dental practice). The page is actually a post on a Wordpress install where customers can enter their testimonials as WP comments. In an effort to encourage more clients to give more testimonials I was considering setting up an iPad or other tablet at the receptionist's desk where patients would be able to enter their successes as comments on the page. If I made sure the patients all used unique names and emails in the Wordpress comments, would Google still see all the comments are from the same IP and view this as suspicious?
On-Page Optimization | | jargomang0