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
-
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 -
Indexing Issue of Dynamic Pages
Hi All, I have a query for which i am struggling to find out the answer. I unable to retrieve URL using "site:" query on Google SERP. However, when i enter the direct URL or with "info:" query then a snippet appears. I am not able to understand why google is not showing URL with "site:" query. Whether the page is indexed or not? Or it's soon going to be deindexed. Secondly, I would like to mention that this is a dynamic URL. The index file which we are using to generate this URL is not available to Google Bot. For instance, There are two different URL's. http://www.abc.com/browse/ --- It's a parent page.
Technical SEO | | SameerBhatia
http://www.abc.com/browse/?q=123 --- This is the URL, generated at run time using browse index file. Google unable to crawl index file of browse page as it is unable to run independently until some value will get passed in the parameter and is not indexed by Google. Earlier the dynamic URL's were indexed and was showing up in Google for "site:" query but now it is not showing up. Can anyone help me what is happening here? Please advise. Thanks0 -
Can OG titles be used as a substitute for Meta titles
We use og (open graph) titles in lieu of meta titles. Is there any downside to using just one. Should we be using both og and meta titles on our page. Appreciate any insight. Himanshu
Technical SEO | | patilhimanshu0 -
Title tag not showing on google? Please Help!
I've read the FAQs and searched the help center. My URL is: http://www.webygeeks.comI have updated title tags of my client's website 10-15 days ago, still the title on google is coming as the company name 😞 Why so??Description is correct but title is incorrect, can you please recommend me something guys?Also, i am wondering why the google cache is showing date of september 5 and we have changed the titles around 10 - 15 days before that http://webcache.googleusercontent.com/search?q=cache:P45GOiHRaIUJ:www.webygeeks.com/+&cd=1&hl=en&ct=clnk Really appreciate your suggestion.
Technical SEO | | lvp11380 -
Changing images on site without losing ranking
A number of images on my site rank very well under google image search but need to be replaced with updated versions. If I keep the file name and pixel dimensions identical will switching the image effect my rankings? Thanks!
Technical SEO | | Justin450 -
Duplicate page titles on Ecommerce
Hi, My question is in reference to an E-commerce site- Our SEO MOZ scan is showing many errors for Duplicates- such as Duplicate titles - The majority of these are on the products map- and the page titles are Products Map :: Company Name How do we get correct this or does Google not penalize for it? Thanks.
Technical SEO | | frankrizzo0 -
How should I shorten my titles?
I've read that page titles can't/shouldn't be more than 70 characters long. Out of around 1,000 products we have about 150 that have legitimate titles that exceed this character limitation. We plan on automatically truncating these. Should I just cut the titles off at 70 characters or should I cut them off and add a "..."? Does it even matter?
Technical SEO | | dbuckles0 -
Alt and Title Attributes in Anchor Tags
Does it hurt to use alt and title attributes inside an anchor tag? Example: view my website article
Technical SEO | | donationtown0