Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Hide or Style your Subcategories in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Hide or Style your Subcategories in WordPress

Subcategories are great because it helps us sort content, but sometimes it looks ugly in the template. In this tutorial, we will show you how you can either hide the subcategories, or you can style them with one single code snippet.

First open your style.css, and then add the following code to hide the sub categories:

.children {

Now you can also use the same code to style them as well for example like this:

.children {
padding: 0 0 0 5px;
margin: 0 0 0 2px;
border-left: 1px solid #333;

Feel free to change the code to meet your standards. People actually thought this would be a very hard thing to do, but this is actually very easy.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Quoc Thai says:

    Thank you for your tutorials ! :))

  2. Phaoloo says:

    Simple and useful as always :D

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.