We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

ExpressionEngine 2 SEO module

Development and Programming

dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

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!

       
dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

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"}'}
       
rubjo's avatar
rubjo
49 posts
15 years ago
rubjo's avatar rubjo

Thanks for developing this for EE2! Exactly what I was looking for - seems like it covers the essential functionality needed.

Now to try it out!

       
rubjo's avatar
rubjo
49 posts
15 years ago
rubjo's avatar rubjo

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?

       
dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

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!

       
rubjo's avatar
rubjo
49 posts
15 years ago
rubjo's avatar rubjo

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?

       
dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

Interesting - very well could be.

Does your HTML specify and encoding? What encoding are the tables created by the module within your database?

       
johnwbaxter's avatar
johnwbaxter
651 posts
15 years ago
johnwbaxter's avatar johnwbaxter

On an SEO side of things, should you really have default content?

       
dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

I don’t want to get into a discussion of best SEO practices, however, I do see your point!

I’ll edit the plugin to give you the option of whether you want to use the default settings or not (per field).

(Hopefully I’ll be able to do that today!)

       
johnwbaxter's avatar
johnwbaxter
651 posts
15 years ago
johnwbaxter's avatar johnwbaxter

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!

       
dstechroom's avatar
dstechroom
113 posts
15 years ago
dstechroom's avatar dstechroom

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.