Disable WordPress’ Built-in Canonical URL

If you’ve upgraded to the 2.9 track of WordPress (and if not, why not) you may have noticed that the new built-in canonical URL function is a bit hinkey.

Thankfully most of the common SEO plugins for WP already handle canonical URLs quite nicely, so the best thing to do for now is to disable the built-in URL generation.

You can do this quite simply by adding the following to your theme’s functions.php:

# Remove WordPress' canonical links
remove_action('wp_head', 'rel_canonical');

Simples!