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
-
301 or Keep 2 Chocolate Best Sellers SEO?
Hi All, So we have two best selling organic chocolates that are very similar. http://www.santabarbarachocolate.com/bulk-organic-dark-chocolate-72-without-soy-lecithin/ and http://www.santabarbarachocolate.com/bulk-organic-dark-chocolate-72-without-soy-lecithin/ Because we are a small company it would be ideal to offer only one of these chocolates due to the cost of making it from the raw cacao. This is the question: From a SEO page rank perspective, do we get better rank by 301 redirecting one chocolate to the other thereby generating more traffic through traffic consolidation to one chocolate. Or do we get better SEO rank by having two chocolates on the site that both get clicks with different content? Basically it is a question of divided forces. Thanks for your help, Jason
On-Page Optimization | | santabarbarachocolate0 -
Client Worried About SEO Decline After Site Redesign
Hi, We're in the process of redesigning www.directvillasflorida.com/ for a client. The client has recently expressed concern that their rankings may drop off after the change. Here are some facts about the site: As you can see, the current homepage is _very _keyword heavy. They have a DA of 26 and are ranking #1 for 'florida villas', higher than their more authoritative competitors. They are also ranking #1 in the mobile search results, despite not being mobile-friendly. Their link profile is pretty average and the anchor texts are pretty keyword-rich 'florida villas' appears 30 times with a 4.41% keyword density 'florida' appears 66 times with a 3.31% density The client has admitted keyword stuffing years ago and hasn't changed anything because it worked and still is working. In the site redesign, we've cut out a lot of the spammy, keyword-rich content and he's worried he'll suffer because of this. Any ideas what to do here? It seems clear that the site is breaching Google's guidelines, but, for whatever reason, isn't being picked up by Google. Cheers, Lewis N.B. The client is just paying us for a redesign, not SEO.
On-Page Optimization | | PeaSoupDigital0 -
SEO Optimization for Sales Page
Hi, I am new to eCommerce. Traditionally I have run a couple of semi-successful websites relying largely on Adsense revenue and affiliate income. So I have a bit of experience with on page and off page SEO. This time around I am creating a membership site and also sell eBooks as bundles that non members can buy. My question is, should I SEO optimize the sales page for my eBook or use another content page that links to the sales page. For example, if I am selling an ebook on Dog Training and targeting the main KW "Dog Training Tips", should my sales page be optimized for "Dog Training Tips"? The reason I ask is because typically Sales pages do not provide a lot of useful information but are more geared around selling the product. The other option would be to create a helpful information page targeted for "Dog Training Tips" and lead users to my sales page through contextual links, banners, popups (I hate popups), etc. This would be the approach for the other LSI keywords anyways. Any thought would be appreciated.
On-Page Optimization | | dwautism0 -
SEO targeted text on Mobile Site Version
Hey Mozzers, I run SEO for a retail site www.uncommongoods.com. We are building a mobile version of our site on m.uncommongoods.com On each of the category pages of www.uncommongoods.com, we have included a few lines of text at the bottom of the page to get some of our target keywords into the body. As an example, if you look at this page: http://www.uncommongoods.com/office/journals-stationery/journals You'll see this copy at the bottom: "Find unique journals and diaries at UncommonGoods. Our creative journal gifts are great for marking special occasions with sentimental keepsakes." We are debating whether or not to remove this copy on the category pages of our mobile site, just to keep the pages as clean as possible. Would there be any risk in leaving this out ? Thanks for your help on this! -Zack
On-Page Optimization | | znotes0 -
Trying to SEO a site that used Header Tags for Design
I am trying to SEO a website that was built years ago and uses Header tags for design. The site must have 25 and tags used for design purpose. Is there any way to work around this problem? Perhaps a code that tells Google to ignore these as Headers? The web designers say that they are looking to fix the problem sometime this summer but you never know if that means it a month away or years away. I really want to help this website but I believe that the Header tags are one of the reasons that his site does not show in the top 100 rankings for any keywords. Any help would be great. www.wallybuysell.com Chris.K
On-Page Optimization | | CKerr0 -
Google Will Now Start Indexing Facebook Comments
Interesting article: http://www.telegraph.co.uk/technology/google/8863354/Google-to-index-Facebook-comments.html
On-Page Optimization | | TheVolkinator0 -
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 -
Very basic hands-on type of question about SEO
Hello, I am a complete newbie to the world of SEO and I have read few thing available on the net about things to begin with (so google seo guide and then seomoz beginers tutorial) and I just wanted to ask if I understand the process correctly: So I have my website lest call it abcd.com and there I might have a subpage about certain type of robots or specific parts that these robots are built from. I do my keyword search using adwords keyword search tool. Where I get 10 phrases (phrase1, phrase2, phrase3 so on..) that could be used by users to search information about certain type of robots I wrote on my website. Let's asume all 10 of those phrases have low competition so they can all be used. And they are from the long tail ofcourse so let's say I can get 10,000 searches from them per month. Some of them would have 200 searches, some 1500, some 5000 per month in that google adwords report. After reading those basic tutorials I understand it this way: I put one or two best phrases of those 10 in my <title></p> <p>2) I describe the website as accurately as possible to those keywords in <meta description> i.e. Those specific robots are built from those specific parts - we know all about them.</p> <p>3) I put all of them in <meta keywords> phrase1,2,3, etc.</p> <p>4) I use one or two phrases in <h1> on the page with article</p> <p>5) then I use those phrases in the text that's on that particular page of my website - text is about certain type of robots and parts etc.</p> <p>6) I put photos on that page with alt descriptions that may contain some of these phrases</p> <p>7) to be honest I don't know how am I suppose to build links from that page about certain type of robots to anywhere else on my website - but I undestand that's the part of SEO as well</p> <p>And that's pretty much how I understand the basics of SEO. I read about it and I just don't know if that's what I am suppose to do. Silly me!</p> <p> </p></title>
On-Page Optimization | | lolskizz1