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
-
HTTPS, free certificates and Google seo
As we all know, Google decided to give some weight in rankings to encrypted sites. SSL certificate providers are quite a lot out there, but there is also a free alternative (Let’s Encrypt). I've been going over some of these services and compared Godaddy's and the above certificates, and there isn't much of a difference. The question is: using a free certificate would have the same effect as a paid one? I would rather pay for one than be punished for using a free one, but free would be good too.
On-Page Optimization | | anitawapa
What's your take on this? Thank you0 -
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 -
"translation" of code in htaccess file
Hi everyone! I am a newbie to the whole SEO and html thing and I am trying to get a better understanding of the "behind the scenes" part of my website. I hope I can find someone here who can translate a piece of code for me that I have in my htaccess file: Options -Multiviews
On-Page Optimization | | momof4
Options +FollowSymLinks
rewritecond $1 !^(index.php|public|tmp|robots.txt|template.html|favicon.ico|images|css|uploads)
rewritecond %{REQUEST_FILENAME} !-f
rewritecond %{REQUEST_FILENAME} !-d
rewriterule ^(.*)$ index.php?link=$1 [NC,L,QSA] I know that something is getting redirected to the index file, but what (or when) exactly? Does the word "robots"mean that search engine crawlers are getting redirected here? And is this good or bad (in terms of SEO)? Or is this redirecting people who try to get to my robots/ template or image files?? Thanks in advance for any answers!0 -
Onpage SEO before Offpage?
Hi there, I want to ask why should a website first have Onpage optimization and after that Offpage optimization or Link building/earning? I have read that this is better, even obligatory in many articles but I am not sure for the reason and benefits of that. Can at least social media optimization start at the same time or at the middle of the Onpage optimization?
On-Page Optimization | | vladokan0 -
Multible Dublicate Titles & Descriptions
Hi, I reviewed a site for a client recently and noticed when I produced a crawl report (SEOmoz) that there were thousands of pages with the same content. This is because the developer added a ticket booking system which has a page for each day up to 2017 (5 years). I see in my campaign monitoring that this results in 9,445 duplicate content errors. The site is only 3 months old and has a Google PR of 4 and is ranking reasonable well for main keywords. Just wondering if there is a way to fix this or should I leave it. Is it eventually going to result in problems?. I cant see these pages when I view the server with FTP - perhaps they are dynamically created. Pat
On-Page Optimization | | Patff0 -
SEO strategy recommendations?
Hi My website http://www.harrisbassett.co.uk is now ranking on the 1st page of Bing and Google for phrases such as Chartered Accountant Swansea and Tax Planners Swansea But the phrase 'accountants swansea' is still performing poorly - as it is near the bottom of the second page? Would I be better placing more accountant swansea phrases on the homepage of the site or would this have an adverse effect on the current 'Chartered Accountants Swansea' ranking as would this be classed as keyword cannabilisation? So would it be better to further optimise http://www.harrisbassett.co.uk/accounting.htm and include the phrases Accountants Swansea and Auditors Swansea or would this act against the homepage? Sorry for the questions I am just looking for the best route forward to further boost the ranking on additional terms as the majority of the 1st page listings seem to weak?
On-Page Optimization | | idv0 -
Onpage SEO Analysis within a campaign
I have setup a campaign and have a number of pages which are ranked as F, but that is because they are comparing against the homepage and not the internal page I have setup. Is it possible to update the page which the campaign monitor is checking against. Or is it driven by the highest ranking page for that keyword. Thanks Andy
On-Page Optimization | | iprosoftware0 -
Are you SEO master? What would you change on my page?
Take a look at this page and tell me what would you change from SEO perspective. It's always to easy to criticise so here is your chance. Good Luck. http://www.traxnyc.com/mens_jewelry.html
On-Page Optimization | | DiamondJewelryEmpire0