Search code examples
wordpresscategories

Wordpress deleting many unused categories


I recently had a web site redesigned and migrated to another domain. The new site uses Wordpress as a CMS for the whole site (it just managed the blog on the previous one). Somehow in the process of setting up the new site, the designer added a whole slew of categories, 953 of them to be exact, and most of them have zero posts attached and will never be used.

I want to clear these zero-categories out, but it would take forever using the WP interface to do this, which only shows 20 at a time. Is there some way to do it with a MySQL operation? I'm reluctant to just delete them from the categories table because I don't know how they are linked elsewhere in the DB. OTOH maybe if the category has zero posts it doesn't matter?

I know there is some WP method to safely do this because the categories page on the dashboard has to call it when you delete a category, but I can't figure out what it is from looking at the form.


Solution

  • If you click the 'screen options' button at the top of the control panel you can choose how many categories to display in the WP interface, then do the bulk-delete using the checkboxes.