Avatar of Leevi Graham

LG Better Meta Improve your sites SEO with custom page titles, descriptions, robot meta tags and more.

LG Better Meta 1.6 Commercial

LG Better Meta 1.6 is now MSM compatible, removes the source code attribution from the 1.4.2 freeware version and fixes a bunch of annoying bugs. Purchase a commercial license for single domain (unlimited sub-domains) and recieve unlimited email support and feel good about supporting independent ExressionEngine extension development.

Only $29.95 per license. Register to purchase!

Table of contents

Now Multi Site Manager (MSM) compatible!

The latest release of LG Better Meta 1.6.0 Commercial is Multi Site Manager (MSM) compatible and features a new extensions settings page for easier setup! The new version is available for all existing license holders and can be downloaded from your purchases page.

Upgrading from 1.4?

If you are upgrading from 1.4 backup your site and database first! I also suggest you copy your existing settings and meta template and uninstall the extension (this will not destroy your meta data). The upload the latest version and re-activate the extension. Be sure to copy your old settings back into the extension where applicable.

Features

The LG Better Meta extension adds a new tab to the publish and edit tabs of the ExpressionEngine administration.

The LG Better Meta plugin adds meta information to your template using the {exp:lg_better_meta} tag.

LG Better Meta provides an interface to add the following meta information to a weblog entry:

  • author
  • title
  • description
  • keywords
  • publisher
  • rights
  • identifier
  • date created
  • date modified
  • date valid
  • instructions for robots
  • site title

The values for each piece of meta are collected from various pieces of existing content. However they can be overridden on a per entry basis and furthermore by the plugin tag parameters.

The rendering hierarchy of an entries meta is:

Extension Settings → Standard Entry Values → Better Meta Settings → Plugin Tag Parameters

Screenshots

Requirements

LG Better Meta is an ExpressionEngine extension & plugin and has been tested on ExpressionEngine 1.6+.

Installation

The LG Better Meta extension contains an extension and plugin folder and a language file. To install LG Better Meta follow the instructions below:

  1. Purchase or download the latest version of LG Better Meta
  2. Extract the .zip file to your desktop
  3. Copy extensions/ext.lg_better_meta.php directory to your /system/extensions directory
  4. Copy plugins/pi.lg_better_meta.php directory to your /system/plugins directory
  5. Copy the language/english/lang.lg_better_meta.php file to your /system/languages/english directory
  6. Open the Extensions Manager
  7. Enable Extensions if not already enabled
  8. Enable the extension
  9. Configure the extension settings

Extension Configuration

The LG Better Meta extension has the following extension settings which are used as the default values of the {exp:lg_better_meta} tag.

Weblog IDs [required]
1,2,3

LG Better Meta can be restricted to specific weblogs. The setting value must be a comma separated list of weblog IDs.

Site Author [required]
Leevi Graham

The person or organization primarily responsible for creating the intellectual content of the website. For example, authors in the case of written documents, artists, photographers, or illustrators in the case of visual resources.

Site Description [optional]
Add meta data to your ExpressionEngine entries using LG Better Meta. Extension and plugin installation, settings and usage instructions.

A textual description of the content of the entry.

Google displays the description in its search results under the page title. To display correctly in google search results the description should be no longer than 150 characters.

Site Keywords [optional]
keywords="LG Better Meta, ExpressionEngine, Extensions, Plugins, Search Engine Optimization, SEO, Newcastle Web Design and Development"

Keywords are not used by any of the major search engines, however they do make you focus on your content.

Typically, the topic will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary.

Site Title[required]
leevigraham.com - Newcastle web design and development

The site title will be appended to the entry title separated by the site page title divider.

Site Publisher [optional]
Leevi Graham Web Design & Development

An entity responsible for making the site content available. Examples of a Publisher include a person, an organization, or a service.

Site Rights [optional]
Content published under Creative Commons Attribution-Share Alike 2.5 Australia license (http://creativecommons.org/licenses/by-sa/2.5/au/)

Information about rights held in and over the site content. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.

Site Page Title Divider [required]
- | » . →

The page title divider, divides the site title and entry title.

Site Meta Template [required]
<title>{title}</title>

<meta name='description' content='{description}' />
<meta name='keywords' content='{keywords}' />
<meta name='robots' content='{robots}' />

<link rel='schema.DC' href='http://purl.org/dc/elements/1.1/' />
<link rel='schema.DCTERMS' href='http://purl.org/dc/terms/' />
<meta name='DC.title' content='{title}' />
<meta name='DC.creator' content='{author}' />
<meta name='DC.subject' content='{keywords}' />
<meta name='DC.description' content='{description}' />
<meta name='DC.publisher' content='{publisher}' />
<meta name='DC.date.created' scheme='DCTERMS.W3CDTF' content='{date_created}' />
<meta name='DC.date.modified' scheme='DCTERMS.W3CDTF' content='{date_modified}' />
<meta name='DC.date.valid' scheme='DCTERMS.W3CDTF' content='{date_valid}' />
<meta name='DC.type' scheme='DCTERMS.DCMIType' content='Text' />
<meta name='DC.rights' scheme='DCTERMS.URI' content='{rights}'>
<meta name='DC.format' content='text/html' />
<meta name='DC.identifier' scheme='DCTERMS.URI' content='{identifier}' />

The meta template is rendered using the {exp:lg_better_meta} tag. Variables wrapped in curly braces '{}' are replaced by the meta values.

Index Pages [required]
Yes | No

Instruct search engines to index pages.

Follow External Links [required]
Yes | No

Instruct search engines to follow external links.

Archive Pages [required]
Yes | No

Instruct search engines to archive pages.

Show title in admin tab [required]
Yes | No

Show the meta title option in the Better Meta admin tab.

Show description in admin tab [required]
Yes | No

Show the meta description option in the Better Meta admin tab.

Show keywords in admin tab [required]
Yes | No

Show the meta keywords option in the Better Meta admin tab.

Show author in admin tab [required]
Yes | No

Show the meta author option in the Better Meta admin tab.

Show publisher in admin tab [required]
Yes | No

Show the meta publisher option in the Better Meta admin tab.

Show rights in admin tab [required]
Yes | No

Show the meta rights option in the Better Meta admin tab.

Show robots in admin tab [required]
Yes | No

Show the meta robots options in the Better Meta admin tab.

Usage

Adding meta data to an entry

To add entry specific meta data to an entry follow these simple steps:

  1. Create a new entry in one of the weblogs listed in the Weblog IDs extension setting.
  2. Click the LG Better Meta tab and enter entry specific values.
  3. Complete the entry and save as normal.

The values entered in the LG Better Meta tab will override the default extension settings where applicable.

Outputting entry meta data

The LG Better Meta plugin outputs the meta information to your site using the {exp:lg_better_meta} tag. The tag has many parameters to further customise the meta output.

Simple usage outputs the Meta Template with the default extension settings.

<head>
  {exp:lg_better_meta}
</head>

Outputting entry specific meta

To output entry specific meta you must add either the entry_id= or url_title= parameter to the {exp:lg_better_meta} tag. Lucky for us it is a requirement of the ExpressionEngine templating system that either an entry_id or the url_title in the url for specific entry pages. Knowing this allows us to use segment variables inside the {exp:lg_better_meta} tag.

Example 1: A numberic entry id in an entry url.

The url: http://leevigraham.com/blog/post/3

<head>
  {exp:lg_better_meta entry_id="{segment_3}"}
</head>

The above example will create a page title similar to: Entry Title | Site Title

Example 2: A url_title in an entry url.

The url: http://leevigraham.com/blog/post/foo-bar

<head>
  {exp:lg_better_meta entry_id="{segment_3}"}
</head>

The above example will create a page title similar to: Entry Title | Site Title

Example 3: Displaying a category title and section title.

The url: http://leevigraham.com/gallery/category-archive/category/family-pics

<head>
  {exp:weblog:category_heading weblog="blog"}
    {exp:lg_better_meta title="{category_name}" title_suffix = "Photo Gallery"}
  {/exp:weblog:category_heading}
</head>

The above example will create a page title similar to: Category Title | Photo Gallery | Site Title Goes Here

Example 4: A unique title for your sites homepage.

The url: http://leevigraham.com/

<head>
  {exp:lg_better_meta title="Site Homepage Title" hide_site_title = "y"}
</head>
Example 5: Adding a section reference to the title using the title_suffix parameter.

The url: http://leevigraham.com/blog/post/foo-bar

<head>
  {exp:lg_better_meta title="{segment_3}" title_prefix = "Blog"}
</head>

The above example will create the following page title: Entry Title | Blog | Site Title

Using LG Better Meta inside embedded templates

More often than not you will want to include a header template which includes the {lg:better_meta} tag into another template.

This may make it hard to pass the exact required parameters to LG Better Meta. To solve this issue LG Better Meta ignores unassigned embed tags.

Embedded Header template

This code should be placed in your header template. Chances are you will not embed all the variables but as mentioned above unassigned variables will be discarded.

<head>
  ...
  {exp:lg_better_meta
    entry_id="{embed:entry_id}"
    weblog_id="{embed:weblog_id}"
    url_title="{embed:url_title}"
    title="{embed:title}"
    description="{embed:description}"
    keywords="{embed:keywords}"
    author="{embed:author}"
    publisher="{embed:publisher}"
    rights="{embed:rights}"
    date_created="{embed:date_created}"
    date_modified="{embed:date_modified}"
    date_valid="{embed:date_valid}"
    identifier="{embed:identifier}"
    robots_index="{embed:robots_index}"
    robots_follow="{embed:robots_follow}"
    robots_archive="{embed:robots_archive}"
  }
  ...
</head>

Entries template

Pass the entry_id and other parameters through to the embedded template.

{embed="your_template_group/header_template" entry_id="{segment_3}"}

Tag Reference

LG Better Meta

LG Better Meta makes use of only one tag: {exp:lg_better_meta} whose output can be customised using any combination of the following parameters:

Parameters

entry_id= [optional]
entry_id="1"

The entry_id of a weblog entry.

url_title= [optional]
url_title="this-is-the-entry-url-title"

The url_title of a weblog entry. Hint: Use segment variables so a {weblog:entries} tag is not needed.

title= [optional]
title="This will be prepended to the site title"

The page title will be prepended to the site title separated by the site page title divider.

title_prefix= [optional]
title_prefix="This will be prepended to the entry title"

The title_prefix will be prepended to the page title separated by the site page title divider.

title_suffix= [optional]
title_suffix="This will be appended to the entry title"

The title_suffix will be appended to the page title separated by the site page title divider.

A real world example would be to add categories after the entry title.

hide_site_title= [optional]
hide_site_title="y"

Hide the site title completely. This is useful on a sites homepage where the site title contains the same keywords as the page title.

description= [optional]
description="Add meta data to your ExpressionEngine entries using LG Better Meta. Extension and plugin installation, settings and usage instructions."

A textual description of the content of the entry.

Google displays the description in its search results under the page title. To display correctly in google search results the description should be no longer than 150 characters.

keywords= [optional]
keywords="LG Better Meta, ExpressionEngine, Extensions, Plugins, Search Engine Optimization, SEO, Newcastle Web Design and Development"

Keywords are not used by any of the major search engines, however they do make you focus on your content.

Typically, the topic will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary.

author= [optional]
author="Leevi Graham"

An entity primarily responsible for creating the entry content. Examples of a Creator include a person, an organization, or a service.

publisher= [optional]
publisher="Leevi Graham Web Design & Development"

An entity responsible for making the entry content available. Examples of a Publisher include a person, an organization, or a service.

rights= [optional]
rights="Content published under Creative Commons Attribution-Share Alike 2.5 Australia license (http://creativecommons.org/licenses/by-sa/2.5/au/)"

Information about rights held in and over the entry content. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.

date_created= [optional]
date_created="2007-07-16T19:20:30+01:00"

The date the entry was created in W3C Date format.

date_modified= [optional]
date_modified="2007-08-16T19:20:30+01:00"

The date the entry was modified in W3C Date format.

date_valid= [optional]
date_valid="2007-09-16T19:20:30+01:00"

The date the entry is valid to in W3C Date format.

ExpressionEngine provides an easy way to create dates in the W3C format.

identifier= [optional]
identifier="http://leevigraham.com"

An unambiguous reference to the resource within a given context, typically a url.

robots_index= [optional]
robots_index="index"
robots_index="noindex"

Specifying index will result in robots indexing the page while noindex will result in robots not indexing the page.

robots_follow= [optional]
robots_follow="follow"
robots_follow="nofollow"

Specifying follow will result in robots following links on the page while nofollow will result in links not being followed

robots_archive= [optional]
robots_archive="archive"
robots_archive="noarchive"

Specifying archive will result in robots archiving the page while noarchive will result in robots not archiving the page.

Change Log

Version 1.6.0

  • Added title_prefix parameter
  • Added title_suffix parameter
  • Added hide_site_title parameter
  • Added option to disable LG Better Meta on a per site basis
  • Fixed some character encoding issues
  • Discontinued the 1.4.2 free version due to bugs

Version 1.5.0

  • Added MSM Compatibility
  • Rewrote extension settings panel

Version 1.4.0

  • Extension method names changed
  • Encoding characters bug fixed
  • Editing from pages module bug fixed
  • Source Code fully commented in PHPDoc syntax

Version 1.4.1

  • Added change log to download
  • Added check to see if extension has been enabled when the plugin is used.

Version 1.4.2

  • Fixed issue with other extensions that use tabs
  • Added update messages to CP homepage

License

Creative Commons

The free version of LG Better Meta is is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. A condition of this license is that all source code attribution must not be removed. If you would like to remove the source code attribution please purchase a commercial license.

Commercial License

For those who want or need to remove the source code attribution from LG Polls a commercial version and license for LG Better Meta is available for purchase. To purchase the module return to the top of the page.

View the commercial license agreement.