Developing software in the Real World

Shorter Link: A rev=canonical WordPress plugin

Hot on the heels of my No DiggBar, I've created another extension for WordPress! Shorter Links provides a <link> tag in the <head> section of your page with a shorter url and appropriate tags for use with the new revCanonical system. Further details can be found at, or The link created looks like this: By default, the shorter url is simply {your domain}/{post id}, but the plugin also creates a custom field… continue reading.

Digg bar blocker for WordPress

The DiggBar is a URL shortening service that puts your website within a frame on As a result, the user sees Digg's URL, rather than your URL in their address bar, no matter which page they navigate to on your site. I don't particularly like this, so I've written a small plugin for WordPress that removes it. Go to the No DiggBar page to download it. Tip of the hat to John Gruber for… continue reading.

Fixing — in WordPress

One thing that I've noticed is that whenever I used — in a post, such as this one, WordPress converted the — to &emdash; which whilst very pretty doesn't work so well for people trying to understand command line switches to ./configure! Today, I finally got around to poking into the WP source code to work out what was happening and I tracked it down to the wptexturize function in the wp-includes/functions-formatting.php file. Once I… continue reading.

post2cat doesn't exist after upgrading WordPress

Note to help anyone else who has the same problem! If you are a "little behind" the times when you upgrade you WordPress installation, you may see errors like this: WordPress database error: [Table 'xxx.wp_post2cat' doesn't exist] SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM wp_posts p LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT JOIN wp_categories c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ This is because the tables… continue reading.

WordPress 2.0 Rewrite Rules

We recently upgraded my wife's blog from WordPress 1.5 to 2.0 and it broke the mod_rewrite rules used to support the legacy Movable Type urls. When she migrated from Movable Type to WordPress, we moved to /{year}/{month}/{day}/{slug} type urls from the default Movable Type rule of /archives/{id}.html. We read the manual at the time and put the following into the .htaccess file: RewriteRule archives/0*(d+).html /index.php?p=$1 RewriteRule index.rdf /index.php?feed=rdf RewriteRule index.rss /index.php?feed=rss RewriteRule index.xml /index.php?feed=rss2 and… continue reading.