[wp-hackers] Canonical integration into core

Joost de Valk joost at yoast.com
Tue Feb 17 15:44:09 GMT 2009


Maybe it's about time I weigh in on the subject, as I wrote the first  
plugin that handles this thing, sorry for not being there until now :)

The code below isn't enough, although it solves the annoying comment  
paging url duplication. On most blogs, you can get to a category by  
going to example.com/catname/ and example.com/cat/catname/, etc. etc.  
etc. The tag SHOULD be on every page, and those who say it shouldn't  
be, should re-read the spec.

Regarding the "BECAUSE IT'S NOT WordPress's JOB TO SEO YOUR SITE.": I  
disagree slightly. One of the reasons that WordPress is becoming more  
and more popular is that it's so search engine friendly, out of the  
box. I agree that meta descriptions and keywords are plugin territory,  
but the canonical link asks something that I think is very valid to  
ask of ANY content management system: what is the preferred place  
within your site to get this content?

It helps not only with things like comment paging, but also with  
preventing duplicate content issues due to campaign tagging etc. Many  
of the bigger WordPress users will, for instance, send out mailings,  
and want to tag the links in those mailings. This canonical tag makes  
sure that if someone, by accident, links to that mailing list URL,  
those aren't showing up in the search result pages. It's this kind of  
"automatically doing the right thing" that users enjoy so much.

So, my vote is to include it in core, of course allowing people to  
disable it.

Best regards,
Joost

On Feb 17, 2009, at 3:17 AM, Mike Schinkel wrote:

> Nathan:
>
> So would you support what I proposed: adding to the core a  
> "the_canonical_url()" function for use as a template tag that does  
> essentially the following and then calling that function in  
> header.php of the themes included in core?:
>
>   function the_canonical_url() {
>     echo '<link rel="canonical" href="' . get_the_canonical_url() .  
> '" />';
>   }	
> 	
>   function get_the_canonical_url() {
>     return apply_filters('the_canonical_url',get_permalink());
>   }	
>
> -Mike Schinkel
> http://mikeschinkel.com/
>
> P.S. Please forgive me if these aren't ready for inclusion in core  
> as exactly written; I hacked them together in about 30 seconds...
>
> ----- Original Message -----
> From: "Nathan Rice" <ncrice at gmail.com>
> To: wp-hackers at lists.automattic.com
> Sent: Monday, February 16, 2009 8:12:39 PM GMT -05:00 US/Canada  
> Eastern
> Subject: Re: [wp-hackers] Canonical integration into core
>
> I've obviously been out voted. ;-)
>
> The only way I would support it is if it was either:
> 1. Off by default or
> 2. Made a function that theme authors could use.
>
> I would support functionality that let me, the theme author, put it  
> in my
> <head> section myself.  Any automatic insertion of the tag via an  
> action
> that is on by default gets the big -1 from me.
>
> It's not that I don't think this is a good thing.  It's that I don't  
> think
> it should be on by default. If a theme author wants to use it, they  
> will use
> it.  If not, don't make them have to manually turn it off.
>
> Nathan
>
> My Website
> http://www.nathanrice.net/
>
> My Twitter
> http://twitter.com/nathanrice
>
>
> On Mon, Feb 16, 2009 at 7:24 PM, Mike Schinkel
> <mikeschinkel at newclarity.net>wrote:
>
>> "Nathan Rice" <ncrice at gmail.com> wrote:
>>> In reality, this is an SEO function, which should be up to the
>>> theme to implement, not a plugin OR core functionality.  It's
>>> frivolous.
>>
>> It's not frivolous nor is it just for SEO. It is a useful component  
>> of
>> website architecture and having it in core means you can depend on  
>> it being
>> there rather than just on the 3% of sites where the author decides to
>> install the plugin.  One example of a type of site that could make  
>> good use
>> of this would be Delicious. Basically anything that collects and  
>> stores
>> links can use this, not just search engines.
>>
>>> How about just letting the user define what they want in their
>>> theme source?
>>
>> The user?  Or the themer?  Or the plugin developer?  Most users  
>> wouldn't
>> know the benefit of it so will never consider it.
>>
>> I understand that there may be edge cases where a themer might not  
>> want to
>> not have it included but the solution is to explicitly include it  
>> in the
>> default theme(s) using a "the_canonical_url()" template tag that  
>> the themer
>> can remove, and some infrastructure to support the template tag;  
>> basically
>> filters that would let a plugin change it from the default if there  
>> was a
>> need for that.
>>
>> So this isn't *just* a theming or SEO issue; this is a content  
>> management
>> issue because the user might want to specify it themselves via the  
>> CMS
>> although I'd agree that would be something a plugin could offer.
>>
>> "Daniel Torreblanca" <regulatethis at gmail.com> wrote:
>>> I'm getting so tired of these "omg put this/don't put
>>> this in core" arguments ... then anyone arguing based
>>> on "we can't cause bloat/not enough people will use
>>> it" is basically blowing hot air.
>>
>> +1
>>
>>> Not one single person that I've ever asked about it
>>> has said that they use it or even know what it is.
>>
>> You didn't ask me, but FWIW I use Windows Live Writer and thinks it  
>> is the
>> best thing since sliced bread. Seriously. :-)
>>
>>> So, while I believe support for this new canonical
>>> URL tag SHOULD be included in core, Joost has already
>>> done it in a plugin. Anyone who knows what they're
>>> doing would find this functionality whether it was
>>> in core or in a plugin, and for the vast majority
>>> of people it will make no difference whatsoever.
>>
>> This argument I disagree with. One of the benefits of canonical  
>> URLs is
>> that it cleans up one of the messy parts of the web at large. With  
>> all the
>> affiliate links and ad sourcing links et.al. you have all these  
>> duplicate
>> links and it was hard to get an automated handle on the web at  
>> large.  The
>> more sites that specify canonical links, the less this is a  
>> problem. Because
>> of it's massive footprint WordPress could make a real positive  
>> difference by
>> simply including canonical links in core.
>>
>> So I'll ask from another perspective; what's the harm in doing  
>> something
>> good for the web when what is requires would be so small and simple  
>> to add?
>> Does anyone really feel like this will bloat the core? Srsly?  And  
>> for those
>> saying they will have to filter it out, what's you have now is no  
>> better so
>> what have you lost?
>>
>> -Mike Schinkel
>> http://mikeschinkel.com/
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list