When you author a post in WordPress, it will automatically assign the post to your default category. This is determined by navigating to Settings > Writing and looking for Default Post Category. You can set the default category to a different one of your choosing, and you can even rename “Uncategorized” to something that makes more sense for your site.

The challenge with the WordPress default category is that authors will frequently draft their articles and choose the appropriate category at the end of the process. All too often, they forget to uncheck the default category, so you have lots of mis-categorized, or double-categorized posts. In fact, you can see thousands of WordPress sites out there that have everything categorized under “Uncategorized”, the default setting in WordPress.

We fixed this by running a category checker when our authors publish a post. If there is more than one category assigned, there is a pretty good chance that one of the categories is an errant setting of the default category. Here is a snippet of code that has worked for us.

Latest Developer Blog Articles

Job Listings on GeekWork

Find more jobs on GeekWork. Employers, post a job here.