Hi all -
We’ve developed a fairly simple EE2 SEO Module that we’d like to release to the wild to get feedback on (bugs, feature requests, documentation needs, anything!).
Current Features: 1) Add title, keywords and a description for any entry via a new SEO tab. 2) Set a default title, description or keywords for entries 3) Prepend / Append text to all title tags (can be overridden with template tag) 4) Set visibility to robots via robots meta tag (noindex,nofollow vs other options) 5) Canonical meta tag to reduce duplicate content flags in search engines
Files can be downloaded via github: http://github.com/dsurgeons/ExpressionEngine-SEO (use the Download Source button on the top right).
There is some basic usage in the READ ME doc found there.
Installation: 1) Download source files 2) Add files to folder: system/expressionengine/third_party/seo 3) Install the module via the Add-ons > Modules are in your EE admin area
Let us know what you think!
Here is what an example header might look like. Note the use of embed tags. The header area is best utilized as a template part to be embedded within all other templates.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{embed:seo_title}</title>
<meta name="description" content="{embed:seo_description}" />
<meta name="keywords" content="{embed:seo_keywords}" />
{exp:seo:privacy}
{exp:seo:canonical url="{embed:seo_canonical}"}
<link rel="stylesheet" href="{path='site/import'}" media="screen" type="text/css" />
</head>Here is how you can use the module within a specific entry. Note that we are using the module to get the specific items (title, keywords, description) for the entry, and then passing them along to the header template.
{exp:channel:entries channel="blog" status="open" limit="1"}
{embed='site/.header' seo_title="{exp:seo:title entry_id="{entry_id}"}" seo_description="{exp:seo:description entry_id="{entry_id}"}" seo_keywords="{exp:seo:keywords entry_id="{entry_id}"}" seo_canonical="{title_permalink='blog/article'}"}
...content of page here....
{/exp:channel:entries}Overriding append/prepend settings within the template:
{embed='site/header' seo_title='{exp:seo:title entry_id="{entry_id}" prepend="this will be before the title tag" append="this will be after the title tag"}'}I am having an issue with saving the default options - e.g. setting a Default Description or the robots visibility and then saving doesn’t actually save the information. (Although the EE2 control panel pop-up still says so.) The database table exp_seo_options is empty.
Setting a SEO value for a specific entry works nicely and does save the info in the database.
Any suggestions?
ah, yes -
There was a bug related to inserting initial values, conflicting with some default values set within the code.
I have fixed this. The only file affected is “mcp.seo.php”
You can get this new file in the Git repository.
You shouldn’t need to uninstall/reinstall the module, just replace the mcp.seo.php file.
Thanks for pointing this out!
Setting up everything and saving is working nicely now. Almost there…:
When trying to save individual entry SEO data, characters like “æøå” show up like “æøå” after saving - this works with the default titles/descriptions in the module settings, though.
When looking at the exp_seo_data database contents in phpmyadmin, these characters display correctly. Does this have something to do with my encoding settings?
Yeah cool, it was more an observation than anything!
I’m giving it a go and it seems to work well, have you thought of adding extra metadata options such as dublin core metadata? A fair bit of that could be set as defualt such as language, rights, format, publisher etc etc.
Just a thought!
Great work!
Thanks :D
I’ve updated the module in github.
You can now select whether or not to have the module fall back to the default values.
Note: If you replace the files without a uninstall/re-install, you may get a PHP Notice on the Module settings page until you submit the form.
Files modified: language/english/lang.seo.php mcp.seo.php mod.seo.php tab.seo.php views/index.php
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.