Category in WordPress

Banner for tutorial on how to manage categories in WordPress.

Category is one of default features in WordPress, which helps to sort and group blog posts.

Table of contents:

Categories are flexible in WordPress.

WordPress allows to create primary and sub categories. So, you can have hierarchical arrangement of blog articles.

Besides, a blog post can have more than one category.

In this article, you can learn different ways to manage category in WordPress.

Add category

No plugins needed to create category in WordPress.

To add category:

  1. Go to Posts → Categories page.
  2. Enter category name, its slug (category URL), and category description.
  3. Click Add New Category.
Preview of the Categories page in dashboard.

After that, new WordPress category will appear in the category list.

Add sub-category

You can also have sub-categories.

Sub-categories, or child categories, depend on a top level category, also known as parent category.

The process is similar to adding a regular category. The only difference is a use of the Parent option.

To have a hierarchy for categories, choose the parent category when creating a sub-category.

Edit category

You can edit the name, slug, parent category, and description of your existed category.

To edit category: 

  1. Locate the category list on the Category page.
  2. Put the cursor over the category item in the list.
  3. Click Edit below the name of the selected category.
  4. Make needed changes to the name, slug, parent, and description.
  5. Click Update at the bottom of the page when you’re ready.

After, every posts will display the updated version.

Delete category

The process of deleting a category is similar to the Edit process.

Simply hover over the category item in the list. Then, click Delete to permanently remove the category.

Most importantly, removing a category does not delete its posts. Instead, blog posts will be assigned to the default category.

Note, you cannot remove the default category.

Delete multiple categories

To permanently delete multiple categories at once:

  1. Click the checkboxes next to the categories you would like to delete.
  2. Choose Delete from the Bulk Actions dropdown list at the top of the page.
  3. Click the Apply button to immediately delete the selected categories.

Note, you will not be prompted to confirm your choice.

Set default category

WordPress comes with a default category. The name of the category is Uncategorized.

However, you can to remove the Uncategorized category, and to set own default category.

To define new default category in WordPress:

  1. In dashboard, go to Settings → Writing.
  2. In Default Post Category section, select your new category.
  3. Save your changes.
Preview of Writing Settings page in dashboard. It shows an option to change default category in WordPress.

Note, you must have at least one new category to be able to delete the Uncategorized category.

Categorize posts

You can assign posts to categories using the editor.

  1. Open your post in the editor.
  2. Under Post Settings in the sidebar, expand the Category panel.
  3. Click the checkbox next to the category you want to have for your post.
  4. Publish or Update your post when you are ready.
Preview of the Block editor. It shows active Category options for the post.

Now, the post has your selected category.

Create category from editor

There is a quick method to add category without a need to leave the editor.

  1. In Category panel, click Add New Category to view an option to add the name of the category.
  2. Enter category name.
  3. Click Add New Category to add category.

However, the editor does not allow to add description.

Preview of the Block editor. It shows an active option to add post category in the editor.

You can add description to the newly created category in Posts → Categories.

Find category ID

You can find ID of a specific category by going to Posts → Categories:

  1. Locate the category in the list and put cursor over the selected category.
  2. Click Edit link under the category name to open the Edit Categories page.
  3. Find the Category ID in the page URL after tag-ID at the top of your browser window.
Preview of the Edit Category page in dashboard. It shows a location of the category ID.

Find category slug

You can locate the category slug in the Edit Categories page under the Slug label.

WordPress allows to add category links to menus.

  1. Navigate to Appearance → Customize → Menus.
  2. Choose your menu where you want to add a link.
  3. Click on Add Items to view available menu items.
  4. Select Categories.
  5. Click the + icon next to the category you want to add.
  6. Publish your changes.
Preview of the Menu Settings in the Customizer. It shows options to add category link to menu.

After, the category link in the menu will redirect site visitors to a page that shows posts with that category only.

Exclude categories

WordPress does not provide any options to hide a specific category either on homepage, or on any archive view.

However, there is a way to exclude categories in WordPress.

Ultimate Category Excluder provides easy option to exclude a category in WordPress with just a couple of clicks. This is a free plugin from a WordPress repository.

To exclude categories via plugin:

  1. In dashboard, navigate to Plugins → Add New.
  2. Search for Ultimate Category Excluder.
  3. Install and activate the plugin.
  4. Go to Settings → Category Excluder.
  5. Select categories you want to exclude.
  6. Click the Update button at the bottom of the page.
Preview of the Plugins page in dashboard. It shows an active Ultimate Category Excluder plugin with a location of the plugin’s options.

If you have questions or bug reports regarding the plugin, use the plugin’s dedicated support forum.

Conclusion

Hope, this tutorial was helpful for you to learn methods to manage category in WordPress.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.