January 14th, 2007

Switched over for only a couple of days and I’m already annoyed.

By default, Wordpress pings on every edit of a published post. Given that I have 300+ published posts which I need to start categorizing, and changing categories is an edit, that’s potentially a lot of pings in a short interval; and some of the ping services will ban a site when confronted with such traffic. Installed Christian Davén’s Smart Update Pinger plugin to fix this - but I shouldn’t have to.

I scan my apache error log periodically to debug my own broken links, and to chuckle at the latest virus botnet infestation sweeping the Web. Unfortunately, Wordpress has a couple of issues with 404 (Not Found) errors, and these issues get magnified when you turn on date and name based permalinks, due to the mod_rewrite rules:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]

Suppose a request comes in for http://www.levork.org/narf, narf obviously being a web page that doesn’t exist. Due to the rewrite rule, instead of being dealt with by apache (which would correctly return 404 to the browser) this gets passed to Wordpress’ index.php to deal with. Here lies the issue: by default, Wordpress doesn’t return 404 in the Status Code (the very first line in the HTTP response to the browser), it returns 200. Wordpress does stick a Status: 404 Not Found in the response header, but this is not the same thing. I don’t believe search engines respect Status in the header, they pay attention to the Status Code. For example, I found out that google’s filename based sitemap validation mechanism will bail because part of their check relies on ensuring your website responds correctly with a 404 Status Code (otherwise, anyone could verify ownership of your web site). The fix for this is to stick:

<?php if (is_404()) header("HTTP/1.1 404 Not Found"); ?>

directly into your 404.php template file. Wordpress’ default theme (Kubrick) doesn’t do this! The other related problem is to get system error logging of 404 errors (so the apache error log contains them), and Matt Read’s Log 404 plugin handles this one nicely.

If you link to an entry on your own blog with a relative url instead of an absolute one (/?p=1 instead of http://www.levork.org/?p=1), you won’t get a trackback. This is annoying: absolute URLs to your own website aren’t portable at all.

Embedding a script into a post is either very hard or next to impossible: try inserting a flickr flash badge. There seem to be plugins to deal with this, but I’ve only had to do this once so I’m not too bothered yet.

PHP is its own class of irk, but I’ll leave that for another day.

Oddly, I haven’t had any real complaint about the theming support in Wordpress. It presents the right hooks to get at my blog data and mostly doesn’t get in my way - apart from a propensity to insert H2 and LI tags where I don’t want them, and for the most part there appear to be ways around that.

Leave a Reply

© 1999-2008 Julian Fong