[wp-hackers] Canonical integration into core

Mike Schinkel mikeschinkel at newclarity.net
Tue Feb 17 02:17:45 GMT 2009


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


More information about the wp-hackers mailing list