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
-
Big SEO Changes
Firstly, this is quite extensive so thank you to anyone who answers some or all of the below! So this is quite a lengthy ordeal, and I'm going to start by saying that I'm no SEO expert (yet). I've paid for SEO for years and only on the odd occasion has it made any real difference. It has come to the point now where I've spent so much money on SEO over the years with practically no benefit that I can't afford to do it anymore, so I am teaching myself. So, back in July my website was hacked for a total sum of three weeks. My SEO/Hosting company at the time didn't do anything about it, let the hack sit there and didn't even take the site offline. It just so happened that at the time I was changing over to a new site at the time anyway, so I launched the new site (completely different in structure to the old one), did all of the relevant 301 redirects, and my traffic hasn't recovered since. I have gone from around 100-150 daily visits to 0-10. The descriptions, keywords, alt image tags, h1 & 2, meta data, etc. is all much better (a lot of it was empty on the previous site) on the new site than it was on the previous site so I was assuming it would be better, but it isn't. Anyone got any suggestions as to why this might be? Here are some specific questions: Canonical Problem? My site is ecommerce and lists some products in several categories, that has resulted in a high duplicate content rate. Is it expected/accepted by google that this would be the case for an ecommerce website or do I need to sort out some serious canonical urls to fix the issue? The site structure of my website could also be a problem, but I'm not qualified enough to know for sure. If you view a product/sub-category, then remove the category section of that link, the product will still appear. I don't know if this structure is good or not? i.e. if you click both links below, the link will appear all the same. http://thespacecollective.com/space-clothing/nasa-and-space-t-shirts http://thespacecollective.com/nasa-and-space-t-shirts Is this a problem for SEO? Duplicate Product Tag Problem? I have many duplicate product tags appearing on many products, should these be blocked in the robots.txt? i.e. http://thespacecollective.com/space-memorabilia/space-flown/apollo-11-flown-cm-meteorite-acrylic http://thespacecollective.com/space-memorabilia/space-flown/apollo-11-flown Site Code Structure When choosing the template I would use for my website I did not stop to consider if the code was SEO friendly, this on my part was due to my ignorance on the subject. Is the site structure SEO-friendly or is it hindering my efforts? Website: http://thespacecollective.com Again, thank you to anyone who takes the time to read/care about the issues facing a newbie. My only option now is to learn SEO myself (which is well overdue), so any advice/answers are appreciated!
Technical SEO | | moon-boots0 -
Titling Category Pages Like You Would a Blog Page?
So, with our 600 or so category pages, I was curious... on each of these category pages we show the top 12 products for that category. In trying to increase click through rate, I wonder if it would be prudent to use some of the strategies I see used for Blog posts with thee category pages. i.e. Instead of Category Name - Website Name How about: Top 12 Kitty Litters We Carry - View the Best and the Rest! Or something like that. And then in the description, I could put, "Number 8 made my jaw drop!!!" (Ok, kidding about that one...) But serious about the initial question... Thanks! Craig
Technical SEO | | TheCraig0 -
Javascript redirects -- what are the SEO pitfalls?
Q: Is it dangerous (SEO fallout) to use javascript redirects? Tech team built a browser side tool for me to easily redirect old/broken links. This is essentially a glorified 400 page -- pops a quick message that the page requested no longer exists and that we're automatically sending you to a page that has the content you are looking. Tech team does not have the bandwidth to handle this via apache and this tool is what they came up with for me to deliver a better customer experience. Back story: very large site and I'm dealing with thousands of pages that could/should/need to be redirected. My issue is incredibly similar to what Rand mentioned way back in a post from 2009: Are 404 Pages Always Bad for SEO? We've also decided to let these pages 404 and monitor for anything that needs an apache redirect. Tool mentioned above was tech's idea to give me "the power" to manage redirects. What do you think?
Technical SEO | | FR1230 -
Inconsistent page titles in SERP's
I encountered a strange phenomenon lately and I’d like to hear if you have any idea what’s causing it. For the past couple of weeks I’ve seen some our Google rankings getting unstable. While looking for a cause, I found that for some pages, Google results display another page title than the actual meta title of the page. Examples http://www.atexopleiding.nl Meta title: Atex cursus opleider met ruim 40 jaar ervaring - Atexopleiding.nl Title in SERP: Atexopleiding.nl: Atex cursus opleider met ruim 40 jaar ervaring http://www.reedbusinessopleidingen.nl/opleidingen/veiligheid/veiligheidskunde Meta title: Opleiding Veiligheidskunde, MBO & HBO - Reed Business Opleidingen Title in SERP: Veiligheidskunde - Reed Business Opleidingen http://www.pbna.com/vca-examens/ Meta title: Behaal uw VCA diploma bij de grootste van Nederland - PBNA Title in SERP: VCA Examens – PBNA I’ve looked in the source code, fetched some pages as Googlebot in WMT, but the title shown in the SERP doesn’t even exist in the source code. Now I suspect this might have something to do with the “cookiewall” implemented on our sites. Here’s why: Cookiewall was implemented end of January The problem didn’t exist until recently, though I can’t pinpoint an exact date. Problem exists on both rbo.nl, atexopleiding.nl & pbna.com, the latter running on Silverstripe CMS instead of WP. This rules out CMS specific causes. The image preview in the SERPS of many pages show the cookie alert overlay However, I’m not able to technically prove that the cookiescript causes this and I’d like to rule out other any obvious causes before I "blame it on the cookies" :). What do you think?
Technical SEO | | RBO0 -
Duplicate page/Title content - Where?
Hi, I have just run a crawl on a new clients site, and there is several 'duplicate page content' and 'Duplicate Page Title'' issues. But I cannot find any duplicate content. And to make matters worse. The actual report has confused me. Just for example the about us page is showing in both reports and for both under 'Other URLs' it is showing 1? Why? Does this mean there is 1 other page with duplicate page title? or duplicate page content? Where are the pages that have the duplicate page titles, or duplicate page content? I have run scans using other software and a copyscape scan. And apart from missing page titles, I cannot find any page that has duplicate titles or content. I can find % percentages of pages with similar/same page titles/content. But this is only partial and contextually correct. So I understand that SEO Moz may pick percentage of content, which is fine, and therefore note that there is duplicate content/page titles. But I cannot seem to figure out where I would the source of the duplicate content/page titles. As there is only 1 listed in both reports for 'Other URLs' Hopefully my long question, has not confused. many thanks in advance for any help
Technical SEO | | wood1e20 -
How do i can change my instant preview image?
Since we've put an index.htm file indicating that our webiste is under reconstruction and have removed it few hours after, the instant preview picture still showing the informative message. It has been 40 day since and we've submit our sitemap few times. Is there a way to change it manually?
Technical SEO | | webit400 -
Does IP Changes Affect SEO Metrics?
Okay, So yesterday I asked a question about setting up custom error pages in IIS 6.0 to properly do a 24 hour 503 Service Temporarily Unavailable. With no answer, (not to the despair of the community as the question has NO simple or easy answer 🙂 So after a night of dreaming about solutions 🙂 I realized that we have the ability to just clone the site.... So basically it would just become a redundant server or mirror site for 24 hours. With all that being said the question is..... What SEO pitfalls might I encounter from this if any I suspect none as load balancing and redundancy is a fact of life in the WEB world, especially since it will be a MAX of 24 hours downtime for maint.
Technical SEO | | Jinx146780 -
Multiple title and description change is considered spam?
I'm changing title and description several times throught 1-2 months... will Google penalize me? I'm worried that testing several title and description ideas would affect the site rankings on google. Anyone had a problem with that... or can i continue testing as many titles and descriptions as i want?
Technical SEO | | mosaicpro0