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
-
Does Plus Sign "+" in url affect SEO and Ranking?
there are customized pages on the client's site, they contain brand pages related to Samsung, iPhone, ZTE, LG, Motorola, and HTC Mobile phones.
On-Page Optimization | | dietsuave
For Example:
https://www.unlockninja.com/unlock-apple+phone
https://www.unlockninja.com/unlock-zte+phone
https://www.unlockninja.com/unlock-samsung+phone
Should I recommend them to change the URL structure. ?0 -
SEO for replicated website system
I have a client who has 750 agents. They want to provide them all with a website on a subdomain (mysite.domain.com). The sites will all contain basically the same info, however, this info can be customized on each site by each rep. Most of these reps sell pretty much the same thing, so the customization wont be very dramatic. So the question is, how can we build this replicated website system and deliver SEO value to each site?
On-Page Optimization | | gotchamobi0 -
Choosing a title tag in seo (H1 or H2 or H3)
I look many times on google that what is the best tag to set in title for seo, H1 or H2 or H3 In many forums and sites they are asking that you need to put only H2 tag in title and someone ask to put H1 in title and i am confused, Some body tell me the correct tag for seo in google, or any other search engine.
On-Page Optimization | | seom20140 -
Changing Location & Losing Location Based Keywords
We're a web agency, and we've just moved from Bromley to Sevenoaks. Our website ranks really well for all Bromley led keywords and regularly brings enquiries, but we're no longer based in Bromley. We don't want to lose our rankings, but clearly we can't claim to be based in Bromley when we are now in Sevenoaks. Obviously, we also need to start using Sevenoaks to build up traction for searches in our new area. So the question is - should we create a Bromley or Sevenoaks focused landing page (or both)? Should we change all references of Bromley to Sevenoaks across the site in one go or gradually? Would it be terrible to leave Bromley onsite? Thanks!
On-Page Optimization | | Ecce0 -
Would I be safe canonicalizing comments pages on the first page?
We are building comment pages for an article site that live on a separate URL from the article (I know this is not ideal, but it is necessary). Each comments page will have a summary of the article at the top. Would I be safe using the first page of comments as the canonical URL for all subsequent comment pages? Or could I get away with using the actual article page as the canonical URL for all comment pages?
On-Page Optimization | | BostonWright0 -
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 -
Do you ever forget the SEO basics?
We all get a little sloppy at times. Just yesterday , someone pointed out that I accidentally blocked the robots from one of our primary pages, because it was being included in a wildcard match on one of the disallow commands in robots.txt. Sometimes the mistakes are very basic. The one below is just too funny. I thought I would share the love. Search Google for "MD care" MD Care Inc. - Welcome<a id="LXPLSS_979677678U1"></a> <cite>www.mdcarehealthplan.com/</cite> This is an SEO description that will be seen by the search engines and used in the search results. The meta keywords tag is even funnier: <meta name="keywords" content="spam,the,keywords,here,like,this,and this,good" />
On-Page Optimization | | irvingw2 -
What do you think about Alexa SEO audit?
I wonder if somebody had an experience with alexa's audit. What kind of information they provide? Is it completely useless?
On-Page Optimization | | DiamondJewelryEmpire0