EllisLab text mark
Advanced Search
     
Plugin: Canonical Link Tags (SEO)
Posted: 26 February 2009 12:46 PM
Avatar
Joined: 2006-01-12
182 posts

Earlier this month a new <link> tag parameter became available with the purpose of providing search engines with the definitive URL for pages. I have created a (hugely) basic plugin which will generate these tags for you, so long as your site’s URL structure is completely segment-based. 99.99% of EE sites will be.

To see why you should bother with this see Google’s documentation, Matt Cutts’ writeup and SEOmoz, which describes it as ‘The Most Important Advancement in SEO Practices Since Sitemaps’.

To implement the plugin just upload it and add {exp:canonical_tag} within your <head> tags.

Download the Canonical Link Tags plugin.

 Signature 

ExpressionEngine Development & Addons
Missing Link - Manage content from the frontend
Switchboard - An ExpressionEngine productivity tool

 
Posted: 26 February 2009 07:46 PM   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-02-22
424 posts

Hi!

Interesting plugin.

I put this on my templates… Quick question:

How is this different than just outputting the URL to the page you are on?

As far as I can see, the cononical link is the same as the URL in the location bar.

Why can’t google use that?

Thanks!
Micky

 Signature 

EE2 Plugins: Eencode, Includee, Keywordz, x2html, SizePlus, APStylee

 
Posted: 26 February 2009 08:23 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2006-02-22
424 posts

I guess it seems like EE generates good links anyway… If it is not broke, why fix it?

 Signature 

EE2 Plugins: Eencode, Includee, Keywordz, x2html, SizePlus, APStylee

 
Posted: 27 February 2009 02:09 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts

You may want to read up on this issue, perhaps using the links provided int he first article, these are not regular links we are talking about.

 
Posted: 27 February 2009 05:54 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-12
182 posts
mhulse - 27 February 2009 12:46 AM

Hi!

Interesting plugin.

I put this on my templates… Quick question:

How is this different than just outputting the URL to the page you are on?

As far as I can see, the cononical link is the same as the URL in the location bar.

Why can’t google use that?

Thanks!
Micky

EE does do a very good job of generating consistent links, but you can’t control every link to every page on your site and this is basically a simple means of telling search engines which one is correct.

For example, I can be pretty much certain that it would be possible to access a single page on your site via all of the following URLs:

* http://www.example.com/seg1/seg2/
* http://www.example.com/seg1/seg2
* http://www.example.com/seg1/seg2/?sort=desc
* http://example.com/seg1/seg2/
* http://example.com/seg1/seg2
* http://example.com/seg1/seg2/?S=e943201f992028bf52702755c58e85d8329221c1

What this plugin does is ensure that the correct address, in this case http://www.example.com/seg1/seg2/, is output as the canonical tag setting irrespective of which URL variation is accessed.

The links in my first post all do a much better job of describing it than me, however.

 Signature 

ExpressionEngine Development & Addons
Missing Link - Manage content from the frontend
Switchboard - An ExpressionEngine productivity tool

 
Posted: 27 February 2009 02:03 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2006-02-22
424 posts
Dom.S - 27 February 2009 10:54 AM

The links in my first post all do a much better job of describing it than me, however.

Hi!

I do not mean to sound like I dislike your plugin… I like it a lot.

All of the links you provided were very interesting to read/watch. The yahoo video definitely did a good job at describing the situation.

I guess I just could not think of a spot on my EE powered site where the URL was not already the canonical link… But I think your last post put that into perspective for me. smile

Thanks for the clarification.

Nice work!

Cheers,
Micky

 Signature 

EE2 Plugins: Eencode, Includee, Keywordz, x2html, SizePlus, APStylee

 
Posted: 20 July 2009 02:57 AM   [ # 6 ]   [ Rating: 0 ]
Joined: 2006-02-22
424 posts

Hi, still loving your plugin!

Just thought I would put in a feature request:

$this->return_data '<link rel="canonical" href="' $FNS->fetch_current_uri() . '" />'

It would be nice if the plugin allowed one to change the ” />” at the end… I personally use a non-XHTML dtd, and the ” />” breaks validation.

Thanks!
Micky

 Signature 

EE2 Plugins: Eencode, Includee, Keywordz, x2html, SizePlus, APStylee

 
Posted: 20 July 2009 07:33 AM   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-12
182 posts

I imagine it’s simpler just to edit the line of code in the plugin itself. You’d simply change that line to

$this->return_data '<link rel="canonical" href="' $FNS->fetch_current_uri() . '">'
 Signature 

ExpressionEngine Development & Addons
Missing Link - Manage content from the frontend
Switchboard - An ExpressionEngine productivity tool

 
Posted: 20 July 2009 01:40 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2006-02-22
424 posts

Hi Dom!

Thanks for the quick reply. smile

I actually did edit that line… It was pretty easy.

Just thought I would post a feature request here. No biggy though. smile

Thanks again for your plug!

Have a great day!
Cheers,
Micky

 Signature 

EE2 Plugins: Eencode, Includee, Keywordz, x2html, SizePlus, APStylee