SEO Lite

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.

Download

Go to download page

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:

SEO Lite adds a tab to the standard publish form

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:

SEO Lite settings screen

 

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: AddonBakery

Our blog/index:


{embed="embeds/global_header" default_title="The Blog" default_description="The index of the AddonBakery 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 | AddonBakery

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 | AddonBakery

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.

{canonical_url} in the SEO Lite template (specified in the SEO Lite admin) will always be replaced by the current url. It will remove the pagination segment from the canonical url so if we're on an URL such as /blog/entry/lots_of_new_info/P2 the canonical url will be http://example.com/blog/entry/lots_of_new_info

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).

Changelog

Changelog for SEOLite
=====================
The dates in this changelog use international date format: YYYY-MM-DD (ISO8601)

1.3.3 - 2011-10-14
------------------
* Fixed bug where {canonical_url} would be blank on standard channel entries

1.3.2 - 2011-09-27
------------------
* Changed constructor name

1.3.1 - 2011-09-02
------------------
* Fix for canonical URLs on pages / structure pages


1.3 - 2011-08-30
------------------
* Added support for category_url_title for fetching titles/descriptions of categories (for use as seo metadata)
* Added support for using seo_lite as a tag pair (if done the template won't be used, good for overriding etc.)
* Fixed minor bug in backend where the instructions would not hide after clicking view/hide

1.2.5 - 2011-03-18
------------------
* French language file added
* Renamed language key "welcome" to "seo_lite_welcome" as this sometimes confliced with other modules who used the same language key

1.2.4 - 2011-02-23
------------------

This update includes database changes and requires that you visit the module in the backend (EE will then automatically run the update script).)

* htmlspecialchars() all metadata before output (there were problems with the use of quotes etc. in default description)
* Increased size of the default keywords / descripton to 1024 chars
* Changed coltype of default_title_postfix to VARCHAR(60) instead of CHAR(60) (char would strip trailing space, thus the need for   .. that's no longer needed)


1.2.3 - 2011-02-21
------------------

* Added support for {canonical_url} for use in the SEOLite template like this:	
* Added 'ignore_last_segments' parameter which tells SEO Lite to ignore the X last url segments (ie. 2 would be logical for URL: entries/some_entry_here/sort/asc)
* Improved support for pages - the "Pages URI" will now override "URL Title"
* Minor change in how the "title_postfix" parameter works - the default postfix (specified in admin) will now always be added after this

Docs have been updated with the new tags: http://ee.bybjorn.com/seo_lite/

Need help?

Badge_get_help