SEO Lite documentation

SEO Lite is a lightweight addon for ExpressionEngine which will add a tab where the user can specify meta keywords, descriptions and alternatively override the title with a SEO optimized version.

Installation

Unzip the downloaded zip and place the 'seo_lite' folder in /expressionengine/third_party/. In the ExpressionEngine Control Panel navigate to Addons -> Modules and click "Install" next to the "SEO Lite" addon.

That's it!

After installing SEO Lite your publish entry form will have an extra tab like this:

Configuration

If you navigate to Addons -> Modules -> SEO Lite you will see some settings. They're default values for the module, and are pretty self-explanatory:

Here's a video of implementing SEO Lite in an existing design. Note that it does not contain any audio:

Usage examples

There’s just one tag – {exp:seo_lite} – and it will fetch the template you edit in the backend and populate it with the entry specific data (title/keywords/description)

You can fetch by segment or entry_id.

  • By segment: {exp:seo_lite url_title="{segment_3}"}
  • By entry_id: {exp:seo_lite entry_id="{entry_id}"}
  • Intelligent mode aka Use-Last-Segment-Mode: {exp:seo_lite use_last_segment="yes"}
  • Static mode aka I-Will-Provide-Values-In-Template: (this will output “About Us” for the title tag but still use the default keywords/description for the site): {exp:seo_lite default_title=“About us”}
  • Static mode with everything overridden: {exp:seo_lite default_title=“About us” default_keywords=“new, keywords” default_description=“This description is unique for this page”}
  • Title override: (will ignore whatever specified in the template) {exp:seo_lite title_override=“This is the only thing i Want inside the HTML title-tags”}

Parameters

  • entry_id: The id of the entry you wish to get metadata about
  • url_title: The url title of the entry you wish to get metadata about (perfect for segments);
  • use_last_segment: y/n – use this if you want to fetch metadata based on the last segment (Note; this will work w/pagination as well)
  • category_url_title: optional, use if you wish to fetch a category (title will be category title, description will be category description -- or defaults)
  • site_id: optional, if you are getting content from another site then the current use this
  • default_title: Override the default title in the template
  • default_keywords: Override the default keywords in the template
  • default_description: Override the default description in the template
  • title_prefix: A string to prefix the title with
  • title_postfix: A string to postfix the title with
  • title_override: Title hard override – ignore whatever is set in the database and use this title instead
  • ignore_last_segments: (optional) - specify the number of segments to ignore at the end - e.g. 2 (ie. if you have an url that includes /sort/asc at the end you don't want to include those in the canonical url + when searching for the url entry in conjuction with the "use_last_segment" parameter)
  • friendly_segments: y/n (default is n) if {segment_x} is used in the SEO Lite template make it friendly (ie. ‘this_is_some_url_title_segment’ will be ‘This is some url title segment’)
  • tag_prefix: if you want to prefix the SEO Lite tags, use this (ie. the {meta_description} will be {seo_meta_description} if you add a tag_prefix="_seo"

The template

The SEO Lite template may contain most variables available in standard EE templates.

​​<title>{title} - {site_name}</title>
<meta name='keywords' content='{meta_keywords}' />
<meta name='description' content='{meta_description}' />

You can also use segments (note how to do conditionals here)

<title>{site_name} - {if '{segment_2}' != ''}{segment_2} - {/if}{title}</title>
<meta name='keywords' content='{meta_keywords}' />
<meta name='description' content='{meta_description}' />
<link rel='canonical' href='{canonical_url}' />

The Ultimate Setup™(?)

Here's an example of a blog which uses a global embed which is embedded at the top of every template.

The global header in embeds/global_header:


<html>
<head>
{exp:seo_lite use_last_segment='yes'
title_postfix='{embed:title_postfix}'
default_title='{embed:default_title}'
default_keywords='{embed:default_keywords}'
default_description='{embed:default_description}'
}
</head>
<body>


Our site index:

{embed="embeds/global_header"}

No need to change anything here. Just embed it and SEO Lite will output the default info, which is exactly what we want on the site frontpage.
In our case the title output will be: WeDoAddons

Our blog/index:

{embed="embeds/global_header" default_title="The Blog" default_description="The index of the WeDoAddons blog"}

Here we override the title and description to make those fit the blog better.
The title in /blog/ will in our case be: The Blog | WeDoAddons

Our blog/entry template:

{embed="embeds/global_header" title_postfix=" | The Blog"}

Since SEO Lite will find the entry in this case title, description and keywords will be populated with entry specific content. So we don't need to change those. The only thing we want to do is add " | The Blog" after the entry title.
So the title in /blog/entry/welcome_to_our_new_blog will in our case be: Welcome To Our New Blog | The Blog | WeDoAddons

Canonical URL support

SEO Lite supports the "canonical" meta tag to specify the canonical URL. For more information about the rel="canonical" tag in general read this and this.

For advanced users the ignore_last_segments parameter can be used to specify that the X last segments should be ignored when it comes to the canonical url. A use case here is e.g. an URL which contain a sort parameter, e.g. http://example.com/cars/listings/sort/asc <- you would not want sort/asc to be part of the canonical url so in this case you'd specify ignore_last_segments="2". Note that this parameter also affects entry lookup when you use the use_last_segment="yes".

SEO Lite & MSM Support

SEO Lite supports Multiple Site Manager. To get it to work simply switch to the new site, navigate to the SEO Lite settings and save them on the new site.

Note; if you are pulling content from site_1 in a template on site_2 for instance you'll need to pass site_id="1" to SEO Lite for it to find the content (it will default to the current site_id).