[theme-reviewers] Proposal for new guideline

Justin Tadlock justin at justintadlock.com
Tue Mar 6 22:02:55 UTC 2012

The Hybrid theme does not have a canonical link in the header.  This was 
removed when WP added it, which was quite some time ago.

As a guideline, I already consider your proposal an unwritten 
guideline.  Themes should never add something WP is already doing unless 
they're changing it via hooks.  And, they should never add stuff like 
this directly to header.php.  If anything, it should be hooked to 'wp_head'.

I don't really see the need for an extra bullet-point in the guidelines 
for this (though it wouldn't hurt).  I would think it'd fall under:

"Whether implementing required, recommended, or optional functionality, 
Themes are required to support proper WordPress core implementation of 
all included functionality."

On 3/6/2012 3:47 PM, Joost de Valk wrote:
> Hi all,
> tldr version: I would like a guideline that tells theme developers to 
> /not/ include a rel=canonical link in their theme as it hurts people 
> more than it helps in a lot of cases.
> long version:
> As some of you probably know, I do a lot of SEO consultancy. Some of 
> it is related to people who have suddenly lost all their rankings and 
> want me to help fix it for them. Today I helped out a blogger, unpaid 
> because I just liked his blog as it was about children with Down 
> Syndrome.
> He had recently switched themes /and /started using my WordPress SEO 
> plugin, and of course he was blaming my plugin for his sudden loss of 
> rankings. What I found out though, was that the theme had the 
> following rel=canonical link in the header.php:
> <link rel="canonical" href="<?php echo home_url(); ?>" />
> above the call to wp_head. This was causing each individual post to 
> have a canonical point back to the homepage. Now you should know that 
> Google especially sees a canonical as somewhat of a "soft 301 
> redirect". It basically takes a page that has a canonical pointing 
> elsewhere out of the rankings. The effect is quite dramatic.
> This was a premium theme, whose authors I have since emailed. It got 
> me thinking though: is this in the WP.org guidelines? Apparently, it's 
> not. WordPress itself adds a rel="canonical" through wp_head on single 
> pages, and there's a patch in Trac to add it on more pages. There are 
> several themes in the repository though that have absolutely 100% 
> wrong canonical links in their header.
> This one: http://wordpress.org/extend/themes/digu is an example. It's 
> not popular and hasn't been updated in ages so I wouldn't normally 
> care too much, but I wanted to use it as an example. It has the 
> following code:
> <?php if(is_single()){ ?><link rel="canonical" href="<?php echo 
> get_permalink($post->ID),"\n";?>" /><?php }?>
> <?php if(is_home() || is_tag() || is_category() || is_month() || 
> is_year()){ ?>
> <link rel="canonical" href="<?php bloginfo('url');?>" /><?php echo 
> "\n"; }?>
> .... snip ....
> <?php } ?>
> Using that theme on a live site could kill your rankings instantly, as 
> it would make all category listings etc have canonicals linking back 
> to the homepage. In most cases this would prevent Google from 
> spidering the links to the posts on those pages.
> Now some themes, like Thematic and Hybrid, have somewhat more sensible 
> canonical functions, which makes this a hard discussion. I would vote 
> to call it plugin territory though and keep it out of themes 
> completely. Would love to hear your opinions.
> Best
> Joost
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20120306/dff54e8a/attachment-0001.htm>

More information about the theme-reviewers mailing list