Writing Better Web Page Titles

One of the easiest things you can do to optimize a web page is to write a better title for it. Aside from writing great content, learning how to write better titles is the best thing you can do for your web page. I’ll start with the basics of a page title and then move into more advanced discussion.

What is a web page title?

If you look at the top of your browser window, above the address bar and the menus, you will see “Writing Better Titles – Social Patterns”. That is the page title of this page.

The title of a web page is specified by the title element aka the <title> tag.

Here’s the code for this page’s title:

<title>Writing Better Web Page Titles - Social Patterns</title>

Why is the page title important?

Page titles influence search engine rankings.
Naturally, search engines rank pages with relevant titles higher than web pages without relevant titles. The basic idea is that you are helping the search engine understand your web page through the page title.

The page title is often used as the heading for your site listing in search engines.
Not only does your web page need to rank well, but it needs to attract people to it. Search users will quickly overlook a web page with a lackluster or unrelated page title.

Page titles are the default label for browser bookmarks.
One of the best ways to attract repeat visits is to have someone bookmark your web page. Almost every web browser assigns the page title as the label for the bookmarked web page. If your page title is not descriptive or missing, most people will not remember why they bookmarked your site in the first place.

Page titles are stored in browser history lists.
Similar to bookmarks, browsers by default use page titles to label pages in the browser’s history. There are plenty of times I’ve wanted to find a page in my history but could never find it because the page had a non descriptive title.

RSS generators and content management systems use page titles to create headlines.
For example, any site powered by WordPress (like mine) will generate RSS headlines from page titles by default.

Most people link to web pages using the page title for anchor text.
This is important for two reasons. Search engines place high importance on relevant anchor text – so when someone links to your web page with the same anchor text as your page title, your ranking for words found in your page title will get boosted. The other reason is that your page title will be the call to action on someone else’s page. A weak page title makes for weak anchor text. Without a strong call to action, no one will want to leave the current page they are on.

Tips for Writing Better Page Titles

The most important thing to remember when writing web page titles is that web page titles are almost always read out of context. Normally there is nothing else except for the title to tell people what your site is about (especially with regards to a search engine listing).

Keep your titles short.
Google cuts off its display of titles at around 64 characters. Although Yahoo and MSN display more characters, I’d recommend keeping it under 64 characters. Keep it short and precise.

Write descriptive titles.
Avoid using word tricks and other ways to jazz up your title. Since web page titles may not be displayed with proper context, people will not have any contextual background to relate your title with. People want a clear description of the web pag before they commit to visiting. Don’t risk potential visitors by using a non descriptive title or worse, a teaser type title. Try and summarize your content in your web page title. (Bad title example: Guess why you are going to click here!)

Do not use the same title for all your web pages.
This makes it hard to distinguish between pages. Why make it tougher on the search engines and your visitors? If you need to always include something in your titles, such as a company name or a web site title – place it at the end.

Focus your keywords at the front.
Place the most relevant keywords at the front. Make sure those keywords are on topic, precise, and summarize your content. Search engines gauge word proximity, so always place the keywords that matter at the beginning and close together. Keywords phrases that are split up and too far apart won’t be considered as related.

Write in plain language.
People skim over titles. So any high flown language or clever text will be disregarded. Speak to your readers the way you would like to be spoken to. Try and avoid too much search engine marketing speak – keep it simple and honest.

Avoid unclear titles with more than one meaning.
Since titles typically lack context, ambiguous titles will generate untargeted traffic and waste your bandwidth. Be as descriptive as you need to. If your web page is about brown furry dogs, don’t just title your page “dog”. That title could mean anything. Title it “Brown Furry Dogs”.

Use a call to action.
Remember that your title is the main draw to get people to click through to your site. Start of with your keyword(s) and then follow up with your call to action. Real important for search engine marketing. In a few words you should explain to your reader what they can gain from visiting your site. People should know instantly what they will be benefiting from the moment they click. Even informational sites can utilize this. For example: “Pepto Bismol – Learn how Bismuth Subsalicylate relieves your upset stomach.”

Avoid unneeded words.
Some people like adding extra information in their title tags like article date, site section, or the URL. My advice is to remove anything that does not need to be there (for example: “Click here to head to My Page” could be reduced to “My Page”). If your page title is descriptive enough, there is no reason to add anything else.

Avoid keyword stuffing.
Plenty of beginning SEOs like to stuff all their keywords into the title. Please don’t do this. Focus on a couple and create more pages for the keywords you still want to target. There is no reason to keyword spam.

Use separators instead of words like “and” or “also”.
Search engines ignore widely used words like “and”, “a”, “the”…etc. These ignored words are called stop words. Instead of stop words, use separators like “-” or “|”. This will save you title space and allow you to put more information into your title if needed.

Use your own judgement.

These are a set of tips that can help you write better titles for your readers and for the search engines. Of course there are always exceptions, but hopefully this article provided you with some basic guidelines and gets you thinking on how you can improve your titles.

If you have any tips of your own, leave a comment!

Author: Michael Nguyen

Get the path to a Drupal module or theme

This is a very useful function in Drupal’s API that is hard to find searching online for file system paths to Drupal modules or themes or anything like that.

So to get the path to a Drupal module or theme it’s as simple as:

drupal_get_path('module', $module_name);


drupal_get_path('theme', $theme_name);


History and evolution of PHP

It was eight years ago, when Rasmus Lerdorf first started developing PHP/FI. He could not have imagined that his creation would eventually lead to the development of PHP as we know it today, which is being used by millions of people. The first version of “PHP/FI,” called Personal Homepage Tools/Form Interpreter, was a collection of Perl scripts in 1995. One of the basic features was a Perl-like language for handling form submissions, but it lacked many common useful language features, such as for loops.


A rewrite came with PHP/FI 2 in 1997, but at that time the development was almost solely handled by Rasmus. After its release in November of that year, Andi Gutmans and Zeev Suraski bumped into PHP/FI while looking for a language to develop an e-commerce solution as a university project. They discovered that PHP/FI was not quite as powerful as it seemed, and its language was lacking many common features. One of the most interesting aspects included the way while loops were implemented. The hand-crafted lexical scanner would go through the script and when it hit the while keyword it would remember its position in the file. At the end of the loop, the file pointer sought back to the saved position, and the whole loop was reread and re-executed.


Zeev and Andi decided to completely rewrite the scripting language. They then teamed up with Rasmus to release PHP 3, and along also came a new name: PHP: Hypertext Preprocessor, to emphasize that PHP was a different product and not only suitable for personal use. Zeev and Andi had also designed and implemented a new extension API. This new API made it possible to easily support additional extensions for performing tasks such as accessing databases, spell checkers and other technologies, which attracted many developers who were not part of the “core” group to join and contribute to the PHP project. At the time of PHP 3’s release in June 1998, the estimated PHP installed base consisted of about 50,000 domains. PHP 3 sparked the beginning of PHP’s real breakthrough, and was the first version to have an installed base of more than one million domains.


In late 1998, Zeev and Andi looked back at their work in PHP 3 and felt they could have written the scripting language even better, so they started yet another rewrite. While PHP 3 still continuously parsed the scripts while executing them, PHP 4 came with a new paradigm of “compile first, execute later.” The compilation step does not compile PHP scripts into machine code; it instead compiles them into byte code, which is then executed by the Zend Engine (Zend stands for Zeev & Andi), the new heart of PHP 4. Because of this new way of executing scripts, the performance of PHP 4 was much better than that of PHP 3, with only a small amount of backward compatibility breakage.

Among other improvements was an improved extension API for better run-time performance, a web server abstraction layer allowing PHP 4 to run on most popular web servers, and lots more. PHP 4 was officially released on May 22, 2002, and today its installed base has surpassed 15 million domains. In PHP 3, the minor version number (the middle digit) was never used, and all versions were numbered as 3.0.x. This changed in PHP 4, and the minor version number was used to denote important changes in the language. The first important change came in PHP 4.1.0, which introduced superglobals such as $_GET and $_POST .

Superglobals can be accessed from within functions without  having to use the global keyword. This feature was added in order to allow the register_globals INI option to be turned off. register_globals is a feature in PHP which automatically converts input variables like “?foo=bar” in http://php.net/?foo=bar to a PHP variable called $foo. Because many people do not check input variables properly, many applications had security holes, which made it quite easy to circumvent security and  authentication code.

With the new superglobals in place, on April 22, 2002, PHP 4.2.0 was released with the register_globals turned off by default. PHP 4.3.0, the last significant PHP 4 version, was released on December 27, 2002. This version introduced the Command Line Interface (CLI), a revamped file and network I/O layer (called streams), and a bundled GD library. Although most of those additions have no real effect on end users, the major version was bumped due to the major changes in PHP’s core.


Soon after, the demand for more common object-oriented features increased immensely, and Andi came up with the idea of rewriting the objected-oriented part of the Zend Engine. Zeev and Andi wrote the “Zend Engine II: Feature Overview and Design” document and jumpstarted heated discussions about PHP’s future. Although the basic language has stayed the same, many features were added, dropped, and changed by the time PHP 5 matured.

For example, namespaces and multiple inheritance, which were mentioned in the original document, never made it into PHP 5. Multiple inheritance was dropped in favor of interfaces, and namespaces were dropped completely. You can find a full list of new features in Chapter, “What Is New in PHP 5?” PHP 5 is expected to maintain and even increase PHP’s leadership in the web development market. Not only does it revolutionizes PHP’s objectoriented support but it also contains many new features which make it the ultimate web development platform.

The rewritten XML functionality in  PHP 5 puts it on par with other web technologies in some areas and overtakes them in others, especially due to the new SimpleXML extension which makes it ridiculously easy to manipulate XML documents. In addition, the new SOAP, MySQLi, and variety of other extensions are significant milestones in PHP’s support for additional technologies.

Author: Andi, Stig and Derick