The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. On-Page / Site Optimization
    4. Developer comments in code & SEO

    Developer comments in code & SEO

    On-Page / Site Optimization
    8 6 1.5k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zabba
      zabba last edited by

      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

      z1eEy

      1 Reply Last reply Reply Quote 0
      • Theo-NL
        Theo-NL last edited by

        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).

        1 Reply Last reply Reply Quote 2
        • DougRoberts
          DougRoberts last edited by

          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.

          1 Reply Last reply Reply Quote 4
          • zabba
            zabba last edited by

            Thanks, just a file size issue then. Sorry the image is taken from SEOmoz as an example.

            1 Reply Last reply Reply Quote 0
            • groovykarma
              groovykarma last edited by

              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.

              1 Reply Last reply Reply Quote 1
              • AlanMosley
                AlanMosley last edited by

                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.

                EGOL 1 Reply Last reply Reply Quote 1
                • EGOL
                  EGOL @AlanMosley last edited by

                  Developer comments would not survive on one of my sites.

                  AlanMosley 1 Reply Last reply Reply Quote 1
                  • AlanMosley
                    AlanMosley @EGOL last edited by

                    I dont use comments either, i like to see nice easy to read html

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    • First post
                      Last post
                    • Messy codes in Page source affecting my SEO
                      Shervin
                      Shervin
                      0
                      6
                      669

                    • Changing commenting platforms...will deleting old comments hurt SEO?
                      max.favilli
                      max.favilli
                      0
                      3
                      455

                    • SEO, 301s & backslashes at end of URL
                      MSpencer
                      MSpencer
                      1
                      5
                      319

                    • Woocommerce ULRs & SEO
                      MagneticOne
                      MagneticOne
                      0
                      4
                      170

                    • Is Disqus comments useful as per SEO?
                      klikik230
                      klikik230
                      0
                      4
                      7.7k

                    • Product Descriptions & SEO
                      Dr-Pete
                      Dr-Pete
                      0
                      6
                      1.1k

                    • Do Blog Comments On Your Site Help SEO?
                      tgerencer
                      tgerencer
                      0
                      5
                      7.0k

                    • FAQS For Seo & Long Tail Optimization
                      gcdtechnologies
                      gcdtechnologies
                      0
                      5
                      1.3k

                    Get started with Moz Pro!

                    Unlock the power of advanced SEO tools and data-driven insights.

                    Start my free trial
                    Products
                    • Moz Pro
                    • Moz Local
                    • Moz API
                    • Moz Data
                    • STAT
                    • Product Updates
                    Moz Solutions
                    • SMB Solutions
                    • Agency Solutions
                    • Enterprise Solutions
                    • Digital Marketers
                    Free SEO Tools
                    • Domain Authority Checker
                    • Link Explorer
                    • Keyword Explorer
                    • Competitive Research
                    • Brand Authority Checker
                    • Local Citation Checker
                    • MozBar Extension
                    • MozCast
                    Resources
                    • Blog
                    • SEO Learning Center
                    • Help Hub
                    • Beginner's Guide to SEO
                    • How-to Guides
                    • Moz Academy
                    • API Docs
                    About Moz
                    • About
                    • Team
                    • Careers
                    • Contact
                    Why Moz
                    • Case Studies
                    • Testimonials
                    Get Involved
                    • Become an Affiliate
                    • MozCon
                    • Webinars
                    • Practical Marketer Series
                    • MozPod
                    Connect with us

                    Contact the Help team

                    Join our newsletter
                    Moz logo
                    © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy