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. Technical SEO Issues
    4. Does Javascript above the body tag impact SEO?

    Does Javascript above the body tag impact SEO?

    Technical SEO Issues
    5 4 1.1k
    • 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.
    • Guest
      Guest last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • USHoleInOne
        USHoleInOne last edited by

        I would probably clean it up. Take that javascript code, put it in a new .js file and load it externally.

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

          I agree with Nicholos. Even though it probably won't hurt your rankings (perhaps a little in loading time or by placing your keywords further down the code), I would indeed put the code in a separate .js file. This way the users' browsers will cache the code as well, speeding up the website in the process.

          1 Reply Last reply Reply Quote 1
          • Guest
            Guest @USHoleInOne last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • RyanKent
              RyanKent last edited by

              I agree with Nicholas and Theo. A website's code should be clean and efficient. With that said, I'll specifically answer the question and say that No, the javascript you described will not have any negative impact on SEO except as it pertains to page loading speed.

              I would suggest using PageSpeed or a similar tool and track page loading efficiency. Trade with and without javascript enabled. If the difference is very small, then there is not any negative impact to SEO. If the difference is larger, then there COULD be an impact.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post
              • # Tag - opacity and SEO impact
                Tiffany_Barn
                Tiffany_Barn
                0
                5
                43

              • Menu impact on SEO
                RobCairns
                RobCairns
                0
                2
                253

              • SEO impact classifieds website
                JarnoNijzing
                JarnoNijzing
                0
                6
                615

              • E Tags and SEO relevance
                RobertFisher
                RobertFisher
                0
                2
                261

              • Redirection Impact on SEO
                SanketPatel
                SanketPatel
                0
                2
                347

              • Does server location impact SEO?
                Wallander
                Wallander
                0
                4
                9.3k

              • I use All in one SEO pack for wordpress and i i have 2 meta tags i need to delete them is this the meta description tag ?
                mad2k
                mad2k
                0
                2
                415

              • Javascript bad for SEO?
                AdamThompson
                AdamThompson
                0
                3
                2.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