Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
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
-
Redirection chain and Javascript Redirect
Hi, A redirection chain is usually defined as a page redirecting to another page which itself is another redirection. URL1 ---(301/302)---> URL2 ---(301/302)---> URL3 But what about Javascript redirect? They seem to be a different beast: URL1 ---(301/302)---> URL2 ---(200 then Javascript redirect)---> URL3 From what I know if the javascript redirect is instant Google counts it as a 301 permanent redirection, but I'm still not sure about if this counts as a redirection chain. Most of the tools (such as moz) only see the first redirection. So is that scenario a redirection chain or no?
Technical SEO | | LouisPortier0 -
Duplicate titles from hreflang variations
Hi, I am working on a large global site which has around 9 different language variations. We have setup the hreflang tags and referenced the corresponding content as follows: (We have not implemented a version X-default reference, as we felt it was not necessary) Using DeepCrawl and Search Console, we can see that these language variations are causing duplicate title issues. Many of them. My assumption was that the hreflang would have alleviated this issue and informed Google what is going on, however i wanted to see if anyone has any experience with this kind of thing before. It would be good to understand what the best practice approach is to deal with the problem. Is it even an issue at all, or just the tools being over-sensitive? Thank you in advance.
Technical SEO | | NickG-1230 -
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 -
Problems with Meta Title on Bing
On the Bing search engine, it isn't showing the actual meta title we have for a website. It's showing something different. However, the correct meta title is showing on the Google search engine. Has anyone had the same issue? Has anyone been able to fix this issue? Thanks for your help!
Technical SEO | | Harrison.Stickboy0 -
Seeing URL Slugs as search result titles
I've been seeing some search results for my site that look like the first result here, where the URL slug is used as SERP title: https://drive.google.com/a/fitsmallbusiness.com/file/d/0B37y4RslpuY-a0hQYjlJQ0NxeFJicDF6RVlURFVSNFN0aGhB/view?usp=sharing The article title (and Yoast snippet title) are both "28 Press Release Examples From The Pros", but for some reason I'm seeing "press-release-examples" in the search results. I've seen this for multiple articles, and I see it now and then with different articles. I'm aware that Google often changes the titles in search results, but it seems very weird to me that they would opt for just the URL slug here. Thoughts? Has anyone else seen this issue? Any idea what might be causing this? All help much appreciated.
Technical SEO | | davidwaring0 -
Resubmit sitemaps on every change?
Hello Mozers, Our sitemaps were submitted to Google and Bing, and are successfully indexed. Every time pages are added to our store (ecommerce), we re-generate the xml sitemap. My question is: should we be resubmitting the sitemaps every time their content change, or since they were submitted once can we assume that the crawlers will re-download the sitemaps by themselves (I don't like to assume). What are best practices here? Thanks!
Technical SEO | | yacpro131 -
Changing title tags, do we need 301 redirects
I found many duplicate title tags and I'm in the process of changing it Do I need 301 redirects in place when I switch it? I am only changing the title tag. Also, we are switching over to a new site very soon, I am worried that we might be using too many 301 redirect "hops" because we are doing a lot of optimization as well. (video from matt cutts describing 301 redirects and hops: http://www.youtube.com/watch?v=r1lVPrYoBkA. Does anyone have any experience in doing too many redirect hops that it affected your rankings? Any good ideas to avoid this?
Technical SEO | | EcomLkwd0 -
Why are apostrophes and other characters still showing as code in my titles?
Hi, I have a WordPress-based site and overall everything is working well. However, I can't seem to figure out how to get apostrophes and other characters to display normally. Now, the problem isn't that they are displaying as code to normal visitors or up in the title bar, they are displaying as code to Google's bots as well as to SEOMOZ. Example: Normal visitor sees: About **** | **** - Metro Vancouver's IT & Web Experts Google and SEOMOZ see: About **** | **** - Metro Vancouver's IT & Web Experts I've played around with different ways of typing the title (not using character codes vs. using character codes) and nothing seems to work. Any help or explanation would be appreciated.
Technical SEO | | Function50