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. Okay to have text in javascript?

    Okay to have text in javascript?

    On-Page / Site Optimization
    3 2 287
    • 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.
    • cakelady
      cakelady last edited by

      There are so many conflicting opinions out there, one of which I recently read indicated that if you are putting your keywords in javascript, the new google update would have an issue with this.

      If you want to keep a page clean looking and have visitors click to read more text, is the opinion here that this is okay or an issue? The main purpose of adding text in javascript would be to have enough content on the page without making it look cluttered.

      Webmaster tools says that when you have hidden text in javascript, the same content should be placed in a no script tag?

      Thanks.

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

        What I've found is that it is okay to have text in JavaScript and Google/Bing will probably index that content if the JavaScript is not too complex. I've seen it not index more intense JavaScript or scripts that require user interaction. You can put alternative text in noscript tags and that seems to work okay.

        Typically though, I recommend putting the super important optimized text in regular old HTML instead of JavaScript. That way you are 100% certain that Google/Bing can crawl and index that content. Plus, it is typically easier to manage content in HTML.

        However, what you said about the clutter makes it sound like your JavaScript is adding effects to text already in the HTML. Is that the case? For example, you have a div on your page that contains some text. By default, it has the style attribute "display:none;". When a user clicks or takes some action, you change that display attribute to shows previously hidden text. Is that what you are doing?

        If that is what you are doing, or something like that, then you have text in HTML not JavaScript. One easy way to check this is to disable CSS and JavaScript then load your page. You want to make sure you can see the content you want Google/Bing to index.

        cakelady 1 Reply Last reply Reply Quote 0
        • cakelady
          cakelady @Matthew_Edgar last edited by

          The client wants to remove existing content to create a cleaner look on the page. I suggested we find a way to keep that content to avoid losing the traffic it generates and turning the page into a low quality page. My thought was to display a portion of the content and have the visitor click to view the rest.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • # and ## repeated, is that okay?
            Alick300
            Alick300
            0
            3
            2.4k

          • Is It Okay If an Inner Page's Anchor Text Isn't Included in TDK Meta Tags of Point-to Page?
            BlueprintMarketing
            BlueprintMarketing
            0
            4
            201

          • Replacing text with images
            Everett
            Everett
            0
            13
            162

          • Is alt text on images treated like text on a page?
            BeardoCo
            BeardoCo
            1
            4
            259

          • Image with Text
            DarinPirkey
            DarinPirkey
            0
            4
            252

          • Text Placement?
            Jungles
            Jungles
            0
            12
            302

          • Is this duplicate content okay?
            SEOKeith
            SEOKeith
            0
            3
            428

          • How long should anchor text be? Best practice for anchor text length?
            RyanKent
            RyanKent
            0
            6
            7.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