Updated: 4 November 2026 · Applies to: WordPress 7.1.3 (screen labels from its source code; WP-CLI 2.12.0 commands tested)
You manage categories in WordPress under Posts > Categories. Fill in the Add Category form on the left to create one; point at a category in the list on the right to Edit, Quick Edit, Delete or View it. Deleting a category never deletes posts: posts that were only in that category move to the default category.
Add a category
- Log in to your dashboard (
https://yourdomain.com/wp-admin) and go to Posts > Categories. - Under Add Category, fill in:
- Name: how the category appears on your site.
- Slug (optional): the URL version of the name, lowercase letters, numbers and hyphens. Leave it empty and WordPress creates it from the name.
- Parent Category (optional): choose a parent to make this a subcategory, for example WordPress under Web Hosting.
- Description (optional): some themes show it on the category page.
- Click Add Category. The new category appears in the table with its Name, Description, Slug and Count (number of posts).
You can also create a category while writing: in the post editor, open the Categories panel in the post settings sidebar, tick the categories for the post or click Add Category (see how to write a new post).
Edit, nest and delete categories
- Rename or change the slug: point at the category and click Quick Edit, change Name or Slug and click Update Category.
- Change the parent or description: click the category name (or Edit) to open the full edit screen, then click Update.
- Delete one: point at it and click Delete, then confirm.
- Delete several: tick them, choose Delete from Bulk actions and click Apply.
- Move many posts at once: in Posts > All Posts, tick the posts, choose Bulk edit and Apply, tick the categories and click Update.
Changing a slug changes the category's address. With "Post name" permalinks the archive URL is https://yourdomain.com/category/your-slug/, so old links to the previous slug stop working; add a redirect if the category was linked from elsewhere (see how to set up redirects in WordPress). The /category/ part can be changed with Category base under Settings > Permalinks.
The default category and "Uncategorized"
Every post needs at least one category. Posts without one, and posts whose only category is deleted, go to the default category. Out of the box that is Uncategorized, which cannot be deleted while it is the default.
- Create the category you want as the default, or simply rename Uncategorized with Quick Edit (for example to General, slug
general). - Go to Settings > Writing, choose it under Default Post Category and click Save Changes.
- Now the old Uncategorized can be deleted; its posts move to the new default. In our test all six Uncategorized posts moved to the new default category.
Video walkthroughs: add a new category, delete the Uncategorized category, remove or delete categories.
Manage categories with WP-CLI
Run these in your WordPress folder over SSH or cPanel Terminal. Our test output:
$ wp term create category "Web Hosting" --slug=web-hosting --description="Guides for shared hosting customers" Success: Created category 2. $ wp term create category "WordPress" --parent=2 Success: Created category 3. $ wp term list category --fields=term_id,name,slug,parent,count +---------+---------------+---------------+--------+-------+ | term_id | name | slug | parent | count | +---------+---------------+---------------+--------+-------+ | 1 | Uncategorized | uncategorized | 0 | 6 | | 2 | Web Hosting | web-hosting | 0 | 0 | | 3 | WordPress | wordpress | 2 | 0 | +---------+---------------+---------------+--------+-------+
- Put a post in a category (replaces its current categories):
wp post term set 1 category wordpress; add one without removing the others withwp post term add. - Rename:
wp term update category 1 --name="General" --slug=general - Change the default category:
wp option update default_category 2 - Delete:
wp term delete category 3(posts only in it moved to the default category in our test).
Watch out: trying to delete the current default category with WP-CLI printed Warning: category 1 doesn't exist. and Success: Term already deleted., yet the category was still there. Change the default first, as above.
Common problems
- A term with the name provided already exists with this parent. Two categories with the same parent cannot share a name. The same name under a different parent is allowed; WordPress then gives it a different slug (in our test
wordpress-2). - There is no Delete link on Uncategorized. It is the default category; change the default under Settings > Writing first.
- Too many categories. Use a few broad categories for the main sections of your site and tags for details. Below the categories table WordPress links to a category to tag converter for moving categories to tags. Tags can also be shown as a cloud (tag cloud in WordPress).
Planning a big clean-up? Back up the database first (back up the database with WP-CLI).
Official documentation: Posts Categories screen, wp term