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
-
Product Tag Value on SEO
Do product tags for ecommerce sites have any benefit to SEO? Or are they redundant? i.e. thespacecollective.com/astronaut-moldavite-pendant (tags appear below the product name on the right)
On-Page Optimization | | moon-boots0 -
Does blogging with a wysiwyg negatively affect SEO (vs. hand coding)?
Many bloggers use a wysiwyg editor to write posts. Are there any drawbacks to wysiwyg vs plain text? When I write blogs I prefer to hand code my text to be sure everything is optimized. My feeling is that wysiwyg leads to code bloat and generally fewer optimization opportunities. I have no real evidence. Is there any reason not to use the wysiwyg editor?
On-Page Optimization | | Jason-Rogers0 -
SEO HTML: Header tags
A few of quick SEO questions regarding header tags: More than one tag per page. If there is more than one tag on a page: are both taken into consideration and what if they contain the same keyword? Eg on the page: http://en.emilea.be/childrens-clothes/molo/boys/cardigans-and-sweaters/ MoloBoysCardigans & sweaters ... Molo childrens clothes Is the 2nd considered when indexing the page? Since both tags contain the same keyword (but in different context) is this a SEO plus or minus? Nested tags inside header tags. I presume the nested tags are omitted, but if there is no white space between the tags are these concatenated? <span tag='molo'>Molo<span tag='boys'>Boys<span tag='cardigans-and-sweaters'>Cardigans & sweaters</span tag='cardigans-and-sweaters'></span tag='boys'></span tag='molo'> How is the above header processed? MoloBoysCardigans & sweaters
On-Page Optimization | | Webxtrakt
or
2) Molo Boys Cardigans & sweaters Order of header tags.
How important is the order of header tags and how do they influence the following content. F.ex. if the top part of the page contains multiple tags and the middle part contains 1-2 tags. Does this affect the importance of the tags and would it be better to use tags above? Thanks in advance.0 -
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 -
Tech/Development Pricing ??
Hi I've submitted some site change request to a clients dev team and they have got back with a rather large quote thats left me gobsmacked, so i want to run it by any of you to get your feedback ? Creating/integrating a dynamic xml site map @ £3450 Fixing Crawl Errors & Warning reported by Moz report (i..e adding canonicalisation tag to each page to deal with dupe content and a few other small/misc items) @ £4850 Setting up/enabling ecom tracking in Analytics @ £910 Setting up 1 events based goal in analytics @ £490 Are these prices even plausible ? Cheers Dan
On-Page Optimization | | Dan-Lawrence0 -
On page SEO Strategy / What pages to use?
What is the best page to use for targeting your hard to rank keywords? The keyword phrases in question here are "Acrylic Tank Manufacturing", "Custom Aquariums", & "Acrylic Aquariums" As of right now we have created 3 separate pages for each one of these keyword phrases. http://seaquaticaquariums.com/custom-aquariums for "Custom Aquariums" http://www.seaquaticaquariums.com/custom-aquariums/acrylic-aquariums/ for "Acrylic Aquariums" http://www.seaquaticaquariums.com/services/acrylic-tank-manufacturing/ for "Acrylic Tank Manufacturing" Or are we better of using the home page http://www.seaquaticaquariums.com/ for the our main hard to rank for terms. Generally speaking I would think more people will link to our home page.
On-Page Optimization | | SeaQuatic0 -
All category seo plugin on Wordpress page title to working
I've installed the all category seo plugin for Wordpress and all works fine except the page title I input doesn't show. Anyone else had that problem?
On-Page Optimization | | SamCUK0 -
Does keyword density on a landing page effect SEO?
I'm relitavely new to SEO, and I just wondered how keyword dense the homepage to our businesses site should be? Is there any value in loading the frontpage at the potential expense of readibility, or should our content elsewhere be responsible for our yield in search engine results? Look forward to any responses. Thanks, Mark
On-Page Optimization | | RobertHill0