Dynamically changing a title with javascript
-
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 ?
-
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.
-
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.
-
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.
-
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
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
-
Dynamically Inserting Noindex With Javascript
Hello, I have a broken plugin creating hundreds of WP-Content directory pages being indexed by Google. I can not access the source code of these pages to add a noindex to them. The page URL's all have the plugin name within them. In order to resolve the issue, I wrote a solution with javascript to dynamically add in a noindex tag to any URL containing the plugin name. Would this noindex be respected by Google and is there a way to immediately check that it is respected? Currently, I can not delete the plugin due to issues with it's php. If you would like to view the code: https://codepen.io/trodrick/pen/Gwwaej?editors=0010 Thanks!
Technical SEO | | Tom3_150 -
Duplicate Title Tags
Hi, Are these 2 title tags different enough? Notice only the 's' on Templates is switched <colgroup><col width="559"></colgroup>
Technical SEO | | Studio33
| Invoice Templates | Invoice Template | invoicing Software | Invoice Software Invoice Template | Invoice Templates | invoicing Software | Invoice Software | Thanks0 -
Totally confused by titles being too long!
We use a wordpress site and have tried some SEO plug-ins in the past. In the analysis, I am getting more than 2,000 pages have titles that are too long and from the results it looks like it was a result of one of these past SEO plug-ins. Do I need to go through and change all those titles? How bad is it that so many of the old blog posts are too long? Some are too long only in the archive link... So confused and hating the idea of reworking thousands of posts! Thanks y'all!
Technical SEO | | Longsphoto0 -
What's the latest on Title Tags?
What is the latest on what Google is looking for? Keyword one, Keyword two? Sentences with the Keyword in them?
Technical SEO | | netviper0 -
Changing Domain Registrars have an affect on rankings?
So, I just wanted to move my domain from GoDaddy to NameCheap. I am still thinking about the move as I am not sure what affect it will have on my rankings. Has anyone here done it before? Did you see any drop in rankings? Also, while I was at it - I was thinking maybe I can add WhoisGuard too. I am not too paranoid about people getting my info from WhoIs, but does having a private Whois have an affect on ranking?
Technical SEO | | uzair0 -
Best way to change from one CMS to wordpress??
I have a client that was working with another SEO consultant and they pretty much dropped the ball big time! The SEO company took his site off of wordpress and put it on another CMS (http://www.wsinetsuccess.com/WSI-E-Fusion). My client would like to take hes site off of the WSI E Fusion platform and back onto wordpress. My question is how is the best way to going about doing this with out loosing all of the PR to the site? Should I find all of the URLs that are on the site and just 301 them to the right page? Thank you very much for your help.
Technical SEO | | pakevin0 -
Updated title tags not displayed in SERPs?
A couple weeks ago I updated the title tags and URLs of some of my site's top landing pages, but the new versions aren't indexed in Google. Webmaster tools says that my site has been crawled since updated. I'm using a pretty old version of Joomla for a CMS, and had to fight with the plugins a little bit to make it all work (sh404SEF for the URLs and sh404SEF Custom Tag Module for the title tags). For example, www.radiussecurityinc.com's indexed title is still: Radius Security Solutions | Home But should be: CCTV System Design - IP Industrial Surveillance | Radius Security Other pages besides the home page have the old title tags as well as old URLs. Any ideas how I can fix this? Thanks a lot in advance! Jeff
Technical SEO | | jaysan0 -
Page title vs page element
Hello! I'm new to SEO as my question would imply. Can someone show me the difference between a page title and a page element? Thank you!
Technical SEO | | atrenary1