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
-
Cross-linking for mobile SEO
Hi everyone! I am having a hard time finding information about weather to/how to apply internal seo linking to mobile versions of sites. We decided to go with dynamic serving with user agent detection. Our desktop site has a quite heavy seo-internal-cross-linking. As I understand, for mobile we should simplify and focus on usability, so get rid of unnecessary links. But I have a doubt about weather removing this part of the web structure can hurt our SEO. Do Google mobile bots look at and rank mobile versions of pages from scratch or do they use what they know about the site and the site's structure from its desktop version?
On-Page Optimization | | ofertia0 -
"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 -
To Many Links & Long Titles
One of our clients currently has a number of pages that "Too many on page links", Now her menu in itself has the majority. With it being an eComerce website it has quite a few categories. How harmfull is this to search rankings. The other side of thing's, Currently the client has a large number of pages where the title of the page is the product, However her products for example could be "The pink fluffy bear 2x4 with extendable arm and voice activation ( batteries not included )" Again, how Harmfull is having a large volume of pages named like this.
On-Page Optimization | | bmkdigital0 -
How Much Does Punctuation of a Word Effect SEO?
I have a page on a site that is targeted for "mens hair cut" and I have received a F for the grade. The content on the page uses "men's" throughout the content. (proper punctuation) When I re-graded the page with "men's hair cut" the page received a B grade. My question is, does mens v.s men's make a different for on-page SEO? Should my targeted keywords include "men's" rather than "mens"?
On-Page Optimization | | Kdruckenbrod0 -
SEO Content Revolution Question
I was wondering if articles written about questions people are asking will help my website rank better. For example let's say I wrote an article answering the query, "What Hair Dye Does Angela Merkel Use?" or, "Is Hillary Clinton Thinking of Running for President," and they rank well on google, and in turn they get viewed a lot by searchers because it answers their queries. Would this help my website as whole start ranking better? Thanks!
On-Page Optimization | | OOMDODigital0 -
SEO- SLIDER
Are sliders bad for SEO. I have a slider that uses HTML elements. The text in the slider is in the source code; however, the words are surround by unreadable code. Give me an example of good SEO friendly sliders for wordpress. Who uses what and why?
On-Page Optimization | | JML11790 -
HAVING A POPUP WINDOW ON HOMEPAGE AFFECTS SEO?
Good evening, I currently have a blog that uses a popup window after 15 seconds that is used to add visitor to my newsletter. My question is : Does it have a negative effect in SEO? Thanks in advance Maria Jesus
On-Page Optimization | | goperformancelabs0 -
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