Title: Title Junk: Solve it with Javascript
Author: Alex Kirk
Published: December 21, 2010

---

# Title Junk: Solve it with Javascript

December 21, 2010

There is some back and forth by [John Gruber](http://daringfireball.net/2010/12/title_junk)
and [others](http://cam.ly/blog/2010/12/startup-title-junk/), about HTML <title>
tags, with Gruber complaining (and rightly so) that for SEO reasons the titles are
filled up with junk having little to do with the real page content.

The writers of [cam.ly](http://cam.ly/blog/2010/12/startup-title-junk/) suggest 
to use the SEO title in the HTML and have something proper be displayed in Google
by using an [OpenSearch](http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document)
description. But this still doesn’t solve the problem of bloated window titles and
bookmarks.

So my solution to that: use JavaScript. If you want to satisfy your readers with
a good title and present a nice title to Google, simply set the title to something
nice after the page has loaded with JavaScript:

`
 document.title = "Title Junk: Solve it with JavaScript";

Everyone happy. Except those who have JavaScript disabled maybe.

I have also created a tiny WordPress plugin that does just that: [title-junk.zip](https://alex.kirk.at/dl/title-junk.zip)

[Discussion on Hacker News](http://news.ycombinator.com/item?id=2028389)

[Web](https://alex.kirk.at/category/web/)

Read this next

[Colorillo: Draw on an LED Wall](https://alex.kirk.at/2010/07/22/colorillo-draw-on-an-led-wall/)

### Leave a Reply 󠀁[Cancel reply](https://alex.kirk.at/2010/12/21/title-junk-solve-it-with-javascript/?output_format=md#respond)󠁿

Only people in [my network](https://alex.kirk.at/friends/) can comment.

This site uses Akismet to reduce spam. [Learn how your comment data is processed.](https://akismet.com/privacy/)