Stop WordPress Returning 404 When Accessing Empty Categories

If you’re using WordPress 2.2.1 — like I am — you might have run into a little problem navigating to a category page that has no associated posts. This was resolved a couple years ago with ticket #1969, but those changes don’t appear to be in my 2.2.1 installation.

It’s a very easy fix: open up wp-includes/classes.php and look for the handle_404 function. Add !is_category() to the main expression and viola! no more 404s for empty categories…

2 comments on “Stop WordPress Returning 404 When Accessing Empty Categories

Leave a Reply