SEO with ExpressionEngine: Page Titles

Posted on 16 February 2010 | by Ryan Battles

SEO with ExpressionEngine: Page Titles

On November 13, 2008, Google published a Search Engine Optimization Starter Guide. As an ExpressionEngine developer, I began thinking about how I could leverage ExpressionEngine to improve my search engine rankings according to this guide. As a result, I will be posting a series of posts as I push my way through this document, one tip at a time, and describe how ExpressionEngine can improve your SEO.

Create Unique, Accurate Page Titles

The <title> tag in between the <head> ... </head> section of the website should be unique for every page on the site. On a site with only five pages, this could be pretty easy, but as the site grows, this could become more of a difficult operation. Thankfully, ExpressionEngine provides a means to create a dynamic page title on the fly, based off of the title of the content of your page.

The easiest way to do this with ExpressionEngine is to make sure that your <title> tag is encased somewhere within the weblog entries tags. For example:

{exp:weblog:entries weblog="my_weblog"}
	<title>{title}</title>	
{/exp:weblog:entries}

This would only work on a specific entry page within a template, such as the one that you are on now. If you are on a general page, such as the blog overview page, or a category page, other means should be employed. There are ways to create dynamic titles for every one of your pages on your site. Here are a few samples taken from the code used to generate this website:

For Yearly Archive Pages, you can pull the year out of the URL.

<title>Jovia Web Studio Blog | {segment_3} Archives</title>

For Category Pages, you can use the Low Seg2Cat Extension to name the category, but I was having difficulty with it on my server configuation, so I worked it out by cycling through the categories and matching them against one of the url segments.

<title>
 {exp:weblog:categories weblog="blog" style="linear"}
	{if "{segment_3}"=="{category_url_title}"}{category_name}{/if}
   {/exp:weblog:categories} | Jovia Web Studio Blog
</title>

I have a Custom Situation in my "About" section. Not only do I have an about us page, but also a few pages that list my services. I have one template to run them all, so I need to run some if/then statements to check and see which page the person is on, and give them a title accordingly:

{if segment_2==""} {!-- This is the general 'about us' page, I can just hard-code this title --}
	<title>About | Jovia Web Studio | Web Design & ExpressionEngine Development</title>	
{if:else} {!-- This is a 'services' page, so I need to generate it's title --}
	{exp:weblog:entries weblog="services"}
		<title>{title} in Columbus, OH | Jovia Web Studio</title>
	{/exp:weblog:entries}
{/if}

Things may get tricky for various pages within the site, but as you grown in your understanding of all the tools ExpressionEngine provides for generating dynamic content, your will be able to create websites that automatically create their unique page titles, and you won't have to worry about it again after development.

 

Tags: expressionengine, seo, web design and development, web design & development,

Related Posts

Start the Discussion, Leave a Comment


Name: (required)
Email: (not published)
URL:

Notify me of follow-up comments

Please enter the word you see in the image below:


Submit
Comment: