Nodewords

Fix for Nodewords module's faulty canonical tag feature

Tags: 

The Drupal module Nodewords is a module that many people have come to love-to-hate - its SEO features are second to none, but a few buggy releases have left a sour taste with many developer.

A key problem with the current stable release is that the canonical URL support is a little faulty.  It can be a problem when sharing content across multiple sites, or allowing other sites to display your content via an RSS feed, that search engines might find two copies of your content, one at your primary site and one elsewhere.  The canonical URL system was developed so that you could add a tag to your page to tell search engines "this URL is the official URL for this piece of content" - simple, and with CMS support, completely painless.

It's a standard feature in Drupal (using the built-in Path module) that you can create friendlier URLs for all of your pages, so instead of "http://example.com/node/123" you can have "http://example.com/products/chicken".  With a combination of modules (PathAuto, Path_Redirect, GlobalRedirect) you can set your site up to automatically create friendly URLs for all content to match specific structures (e.g. products always look like "products/product-name"), let you add aliases for common misspellings or when you rename a page ("products" instead of "product"), and automatically bounce the user over to the correct path regardless of which version they typed.

So taking those two together, the Nodewords module should be using the friendly URL alias to indicate the canonical URL.  Except it doesn't, by default the latest stable release just uses the internal "http://example.com/node/123" format.  A ticket to fix this was added to drupal.org and I provided a patch that gave the site administrator a simple option to decide whether to use the internal path or the alias, but so far the module maintainer has only said he intends to handle this via a completely different structure in his forthcoming rewrite.

While we at Bonnier Corp have been using a patched version of this module with the fix for several weeks, I thought it might help others to test it out and see which they prefer to use without having to deal with applying the patch themselves.  Towards that goal, here's a zip archive of the most recent v6.x-1.11 release with the patch applied so you can make your canonical URLs nice and friendly.  If it works for you, please chime in on the issue on drupal.org.

Attachments: 

Subscribe to Nodewords