Use JavaScript to generate SEO Friendly Title Tags – errr that doesn’t work. Well it looks like it does.

As we know Google doesn’t generally execute all JavaScript, one that Google will is when you amend the title tag using JavaScript .

Working on many projects I’ve been limited by a CMS’s ability to change title tags, either the title tag is generated by the name of the page in the CMS or there is no control on a page by page basis.

When working on large sites that maybe have have 5, 6, 7 month waiting list for development work this JavaScript work around could be used as often you will have access to edit the content on the page or place a tag in the footer / header of a page. You can then get on with your link building campaign.

The code is simple:

So the standard title tag can be used and appended onto the new title title tag, or a brand new title tag could be used.

When you look at the title tag in the HTML source code you’ll see the one hard coded in the head and not the amended JavaScript.

However in your browser title bar you’ll see the JavaScript amended title tag.

Now the important check, if the title tag is picked up when Google indexes the page? Yes

And now for search for the text that the JavaScript adds to the title tag.

Above is a test but I’ve found one or two side who have title tags generated by JavaScript ranking for competitive key phrases.

A few points to note :

  • Doesn’t work with Bing or Yahoo
  • Google may start to not execute this JavaScript
  • This should be last resort, always try to get title tags as a critical change for developers before resorting to this method.

Anyone else testing this? Anyone thinks this is a bad or good idea?


One thought on “Use JavaScript to generate SEO Friendly Title Tags

Leave a Reply