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. Dynamically changing a title with javascript

    Dynamically changing a title with javascript

    Technical SEO Issues
    5 3 272
    • 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.
    • jfmonfette
      jfmonfette last edited by

      Hi, I asked our IT team to be able to write custom page titles in our CMS and they came up with a solution that writes the title dynamically with javascript.

      When I look on the page, I see the title in the browser, but when I look in the source code, I see the original page title.

      I am thinking that Google won't see the new javascript title, so it will not be indexed and have no impact on SEO.

      Am I right ?

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

        Probably not, but would run it through a Gbot emulator to make sure, as Google can parse some Jscript now - But not sure if it would in the section

        Is PhP not an option? as it is dynamic and renders server side and echoes can be used for page by page basis

        jfmonfette 1 Reply Last reply Reply Quote 2
        • jfmonfette
          jfmonfette @Jinx14678 last edited by

          Thank you for your answer.

          PHP is not an option since our website is running on an IIS server. I cannot fetch it as Googlebot yet because the solution is only in our development environment.

          1 Reply Last reply Reply Quote 0
          • Cyrus-Shepard
            Cyrus-Shepard last edited by

            I agree with Shane - this sounds like a bad idea all around. It's fine to generate the title tag dynamically, but it should generate on the backend or your CMS, before the page renders in a browser.

            Google does try to parse javascript for links and content, but it's inconsistent and I'm almost certain they would either see your non-scripted title, or get really confusing signals that could cause trouble later.

            The best solution may be to explain to your Devs that Google most likely wont parse the javascript, and see if they can come up with another solution.

            Best of luck.

            jfmonfette 1 Reply Last reply Reply Quote 2
            • jfmonfette
              jfmonfette @Cyrus-Shepard last edited by

              Thank you for your answer.

              I convinced our IT team to put build the title field in our CMS to be able to write our own titles.

              I was very skeptical of this client side javascript solution too. Now I can work with confidence.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Dynamically Inserting Noindex With Javascript
                JohnSammon
                JohnSammon
                0
                6
                599

              • Competitor Recently Changed his Title to Match Mine
                Unturned
                Unturned
                0
                7
                179

              • Impact of changing title and description.
                Somanathan
                Somanathan
                0
                3
                88

              • Changing title tags, do we need 301 redirects
                TextMarketing
                TextMarketing
                0
                6
                396

              • Changing title tag in wordpress media pages
                BenRWoodard
                BenRWoodard
                0
                3
                278

              • Problems with changing the page title on Wordpress Site...
                KeriMorgret
                KeriMorgret
                0
                5
                813

              • Multiple title and description change is considered spam?
                mosaicpro
                mosaicpro
                0
                4
                879

              • URLs: To Change or Not to Change
                94501
                94501
                0
                8
                1.2k

              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