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
-
Generating Dynamic Meta Titles for SEO - Advice?
Hi, I'm working with a new client that works with a lot of suppliers and they want to have their titles built in a specific way. If I generate a template (so to speak) will generating dynamic meta titles have a negative effect on their SEO and is this even possible? If so, what would be the best way to handle this? There is approximately 100 suppliers. Any feedback/advice is appreciated!
On-Page Optimization | | daniel-brooks0 -
Should I Use WooCommerce Tags & Attributes?
I'm helping an online furniture store search engine optimize a WooCommerce store and I'm trying to make sure our taxonomies make sense. I'd love any help you guys can give, but I'm particularly interested in determining whether we should use tags. Product attributes make sense to me, but I'm concerned to use tags because of the propensity for creating duplicate content. Thanks in advance for any help you guys are willing to give.
On-Page Optimization | | cbizzle0 -
SEO For Replacement Site
I have a client with a website that has gotten a bit outdated. We've already built his new website and optimized it, but I'm trying to figure out the best way to replace the site while doing the least amount of damage to his current Google rankings. He's ranking #1 for some very competitive keywords that are responsible for the bulk of his revenue, so we want to jeopardize that. We've already built a new site and written all new content, although the homepage page title, h1 header and meta descriptions will all remain what they currently are. I'm also trying to keep the keyword density as close to the current site as possible. I am aware of transferring all existing site URLS using 301 redirects. Can anyone provide any tips that I should use when replacing the site? Should I expect a slight rankings drop or am I worrying about nothing?
On-Page Optimization | | atstickel0 -
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 -
Does Channeladvisor really assist in SEO?
I'm getting emails from Channeladvisor recommending I join, thereby taking advantage of a change to Google Shopping. It is starting in Australia from today (13Feb13). Is it an upgraded version of Google Adwords, or another form of a Commerce Merchant (obviously with multiple channels,e.g. Ebay, Amazon etc)? With Adwords, I found it too expensive for the type of product we sell (printer cartridges). But the real question is, DO MY RANKINGS DROP FROM NOT USING CHANNEL ADVISOR?
On-Page Optimization | | ABCPS0 -
Changing Link Title Tags & Backlinks
On 4/19/12 I began changing the link title tags in an effort to further optimize my website. I thought they were excessively long and it would be beneficial to make them more concise. On 4/26/12 my website traffic began to fall drastically and I'm not sure if it is from google's penguin update or from changing the link title tags. I started looking into the sudden drop of traffic and realized that when I run the site explorer tool on all of the pages I changed, the URL is redirecting. It appears that the backlinks are not passing through to the new URL. Before I Changed the Link Title Tag: http://www.opensiteexplorer.org/links?site=www.beautystoponline.com%2FAndis-Professional-Hair-Clippers-s%2F102150.htm **After I Changed the Link Title Tag: ** http://www.opensiteexplorer.org/links?site=www.beautystoponline.com%2FAndis-Clippers-s%2F102150.htm So my questions are: The above example shows that the old title tag (www.beautystoponline.com/Andis-Professional-Hair-Clippers-s/102150.htm) has 43 backlinks and the new one (www.beautystoponline.com/Andis-Professiona-Hair-Clippers-s/102150.htm) has 0. Will the links eventually be attributed to the new URL. I understand that the user will still be directed to my website they click the any of the backlinks, but will the link juice pointing the old URL pass through the new one? Would it be better, in the long run, to continue optimizing the link title tags.
On-Page Optimization | | BeautyStop0 -
On Page SEO Tool
Hello - I'm looking for one tool that does the following and was wondering if anyone knew of such a tool? In a perfect world I would like to enter in one domain name and have a report generated that shows All Internal links, link titles, and anchor text All internal broken links / redirects All images, image size and image alt, if the image alt is missing. I'd love to be about to export these reports to excel and quickly run my on page optimization. The goal is to produce a checklist for a developer to execute quickly. Thanks for your help Gabe
On-Page Optimization | | Gabe0 -
German SEO
Just a quickie, Does anybody know of any strong German SEO agencies? Many Thanks Sean
On-Page Optimization | | Yozzer0