December 17, 2008

Google-friendly SEO for Expression Engine

Article about ▸

written by Marek Foss

Search Engine Optimization (SEO) is a huge market, because frankly these days, if you’re not in the top search results, you barely exist. That’s why it’s a good practice to take some time time and properly prepare your pages, so that the GoogleBot, and others, will like them. Especially since it really takes just a few minutes in Expression Engine (EE).

Let’s start with the basics (props to this post, unfortunately in Polish). The most important thing for Google is the URL, the title of the page, its description, the headers, and just then — the article itself. I already describe how to make Google-friendly links in EE. So lets talk about the rest now.

Title and description

Title and description is what the users will see in the search results, so try to state clearly what the page contains. In the title tag, insert the page name (it’s a good practice to combine the name and the URL, i.e. f055.net), as well as a short tag-line (like lazy design & development). Of course, don’t define your title in the template. Instead, use the {blog_title} EE variable defined in Admin - Weblog Administration - Weblog Management - Edit Preferences as Full Weblog Name. Note the Weblog Description field — it represents the description tag (and can be accessed with {blog_description} variable), so fill it in wisely. I personally tend to just extend the tag-line, but the more accurate summary of the page, the better. Thus, using these variables, in the header section of the template you just put the following:

<title>{blog_title}</title>
<meta name="description" content="{blog_description}" />

Headers

The things with the headers is simple — use them where you have a header, not just a title. So, use the h1 and h2 tag just in your post, and nowhere else across the page. Use h1 just for the post main title, and h2 for the mid-sections, just like I’m doing here i.e. with Headers and Title and Description. If your article is more deeply nested with paragraphs, and you need h3, h4 etc. ensure that they are not used outside your article. Otherwise, you could use it, but bear in mind that they highlight the content, so for example I want to focus attention on my Twitter timeline in the sidebar, so I have it described with h3 tag.

Sitemap and robots.txt

Sitemaps and robots.txt are important, because the former is a file guiding the GoogleBot around your page, and the latter tells it where to and where not to go. However, creating these documents by hand is a tedious job. Therefore, I recommend using something like Google Webmaster Tools. In the Tools section there is a robots.txt generator. I tend to exclude the images and themes, but it really depends on your needs.

With sitemaps, it’s even easier, because the Webmaster Tools sitemap generator accepts RSS feeds. Just be sure to have the feed XML on your domain, because it seems like you cannot submit an external one (for example, FeedBurner) — but that shouldn’t be a problem, since EE provides you with both RSS and Atom feeds (which you then burn, right?).

Unique titles and descriptions

So we discussed the importance of titles and descriptions. But because of all the Black Hat SEO and spam, Google is really careful with duplicated content. One way to tell the GoogleBot not to index a link, is to add a special nofollow attribute, like this:

<a rel="nofollow" href="http://f055.net">
However, this would be another tedious job, and frankly, usually I don't bother. Moreover, it often doesn't make sense, since your site has indeed different contents across the pages. The problem is they all have the same title and description, because of the way we defined the header tags. Google Webmaster Tools would tell you about these problems in Content Analysis of Diagnostics section. Lets change that. First, we will modify the header of articles (or posts, or entries, however you have the template displaying your individual posts named). We're going to include the title of the article, as well as its categories and post date. Note that you have to have your exp:weblog:entries EE module declaration somewhere before the title and description tags, because we are going to use the special {title} variable, as well as {categories} and {date_heading}, all from the Weblog Module. Also note, that you should have the header in an external template, and pass the additional title and description parameters using the {embed} variable to sub-template.
{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="1" disable="member_data|trackbacks"}
...
<title>{title} | {blog_title}</title>
<meta name="description" content="Article on {categories}{category_name}, {/categories} posted {date_heading}{entry_date format='%F %d, %Y'}{/date_heading} | {blog_description}" />

As a result, each article page will have a unique title, as well as a description stating in which category the article belongs, and when it was posted. Changing the title and description of the archive page is straightforward. One problem still left is the categories view, where you see articles just on one topic, like for example here. Notice that there’s a special category keyword in the URL, followed by the category name. This keyword can vary, depending on your system, because you can set it in Admin - Weblog Administration - Global Weblog Preferences under Category URL Indicator. We will use that to make a unique title and description.

It is possible to retrieve the URL as segments. In the example above, segment 1 would be category, and segment 2 — expressionengine. Thus, lets make a condition on the index template that whenever the first segment is, in fact, category, then we will use a special title and description.

    <title>{blog_title}</title>
    <meta name="description" content="{blog_description}" />

As you can see, whenever we are displaying post from a specific category, the title will start with, for example, “Articles on expressionengine”. Here’s the drawback of this method, as we pull the category name directly from the URL, so we don’t have the pretty print name. I still can’t find how to map category identifiers to names in EE. But what we aimed is achieved, and we have all the pages with unique names.

Conclusion

It is very important to have these small optimizations implemented. The point is not only to be high in the rankings, in fact, the bigger benefit is from your content being better organized, easier accessed and searchable. Think of the future when it will be you who wants to find something quickly. These tweaks would certainly make it easier for you.


If you liked the article, please spread the word and share it!

  • Share

Comments


Leevi Graham writes:

You might also want to consider my EE extension - LG Better Meta. It allows you to change meta for the site, individual entries and create XML sitemaps.

Full documentation: http://leevigraham.com/cms-customisation/expressionengine/lg-better-meta/



Leave a comment: (comments may not appear immediately due to page caching)

Name: Email: (not disclosed)

WWW: Remember my details

Notify me of follow-up comments

Feed me:

to feed
  • Subscribe and get the new articles every now and then directly in your reader — I recommend using Google Reader

Facebook:

Connect:

 by Google
Google FriendConnect appears to be down at the moment. Sorry for inconvenience.
Related Posts with Thumbnails