Hey there, WordPress user! Are you tired of posts from certain categories cluttering up your homepage? Maybe you want to keep your blog and online store separate, or perhaps you use a category for site announcements that don‘t belong on the main page.
You‘re not alone – according to a survey by WPBeginner, 62% of WordPress users say they struggle with managing and organizing their site‘s categories effectively.
The good news is there‘s an easy fix. In this step-by-step tutorial, I‘ll show you two foolproof methods to hide WordPress categories from your homepage:
- Using the WooCommerce Exclude Category plugin
- Adding a simple code snippet to your site
Whether you‘re a WordPress newbie or a seasoned pro, you‘ll be able to follow along and declutter your homepage in no time. Let‘s dive in!
Why Exclude Categories from the Homepage?
Before we get to the how-to, let‘s talk about why you might want to exclude certain categories from appearing on your homepage in the first place. Here are a few common scenarios:
Separating blog content from products: If you have a WooCommerce store, you may want to keep your blog posts and product categories separate to avoid confusion. Hiding WooCommerce categories makes your homepage more focused.
Hiding announcement or utility categories: Some sites use categories like "Announcements" or "Asides" for posts that don‘t fit neatly into the main content. These can clutter up the homepage and distract from your core content.
Customizing the homepage experience: Maybe you want to curate the categories that appear on the homepage to guide visitors to your most important content. Excluding irrelevant categories streamlines the user experience.
Of course, every WordPress site is unique – you may have your own specific reasons for wanting to exclude categories. The good news is that the methods below will work for any scenario.
Method 1: Exclude Categories with a Plugin
The simplest way to hide categories from your homepage is by using a plugin. There are a handful of plugins that can do the job, but my top recommendation is WooCommerce Exclude Categories.
Don‘t be thrown off by the name – while this free plugin is built by the WooCommerce team, it works perfectly on regular WordPress sites too. It‘s lightweight, easy to use, and does exactly what it says on the tin.
Here‘s how to use it:
Step 1: Install and Activate the Plugin
First, you‘ll need to install the plugin on your WordPress site. From your admin dashboard, head to Plugins → Add New and search for "WooCommerce Exclude Categories".
Click the "Install Now" button next to the plugin name, wait a few seconds for the installation to complete, then click "Activate".
[Screenshot: WooCommerce Exclude Category plugin installation]Step 2: Choose Which Categories to Exclude
With the plugin activated, head to Settings → Exclude Categories from the WordPress sidebar menu. You‘ll see a list of all the categories currently on your site, along with a set of checkboxes to configure where each category is hidden.
To hide a category from the homepage, simply tick the checkbox in the "Exclude from homepage" column.
You can exclude as many categories as you‘d like – just tick the checkbox for each one. You‘ll also notice options to hide the category from other parts of your site like archives, search results, and RSS feeds. Feel free to use these if needed, but for most users the homepage option is the key one.
When you‘re finished selecting categories, click the "Save Changes" button at the bottom of the screen. That‘s it – if you visit your homepage now, posts from the excluded categories will no longer appear.
Pro Tips for Using the Plugin
While the default settings work great for most users, there are a few extra things to know about using WooCommerce Exclude Categories:
Hiding subcategories: When you exclude a parent category, any child categories will automatically be excluded too. There‘s no need to tick them individually.
Changing exclusion settings: If you decide later that you want to re-include a category, just head back to the plugin settings and untick the checkbox. The category will instantly reappear where it was hidden.
Bulk-selecting categories: To speed things up, you can hold the Shift key and click to select a range of categories all at once, or use Ctrl/Cmd + click to choose multiple non-sequential categories.
Bonus: if you want to completely remove the excluded categories from the WordPress backend too (not just the public-facing pages), WooCommerce Exclude Categories has an option for that under Advanced settings. This can help keep your admin area less cluttered.
[Screenshot: Advanced settings]Method 2: Exclude Categories with Code
If you‘d prefer not to use a plugin, you can achieve the same result by adding a small code snippet to your WordPress site. This method takes a few more steps but gives you complete control and doesn‘t require installing any extra plugins.
Here‘s the code snippet you‘ll need:
function exclude_category_from_homepage($query) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set(‘cat‘, ‘-3, -5, -8‘);
}
}
add_action(‘pre_get_posts‘, ‘exclude_category_from_homepage‘);This snippet uses the pre_get_posts hook to modify the main query on the homepage, telling it to exclude any categories whose IDs are listed.
To use it, replace the example category IDs (3, 5, 8) with the actual IDs of the categories you want to hide. You can find the category ID by going to Posts → Categories in your WordPress dashboard and hovering over the category name – the ID will appear in the URL bar.
[Screenshot: Finding category ID]Where to Add the Code
There are a few places you can add this code snippet:
- Your active theme‘s
functions.phpfile - A site-specific plugin
- A code snippets plugin like WPCode
Unless you‘re comfortable editing theme files, I recommend using a plugin like WPCode. It lets you easily add custom code to your site without risking breaking anything. Here‘s how:
- Install and activate the free WPCode plugin
- Go to Code Snippets → Add New in your WordPress dashboard
- Give your snippet a descriptive name
- Paste the code snippet into the editor
- Select "PHP Snippet" as the type
- Tick the "Automatically insert snippet" box
- Click the "Save Snippet" button
With the code snippet saved and activated, head to your homepage and you should see the selected categories are now hidden.
Pro tip: You can exclude as many categories as you‘d like by listing additional IDs in the $query->set line, separated by commas.
Now you know how to hide categories from your WordPress homepage, but should you? It‘s a valid question, and the answer depends on your specific situation.
In most cases, excluding one or two categories won‘t have a significant impact on your site‘s SEO. Google and other search engines don‘t put a huge amount of weight on the homepage content itself. As long as you‘re not hiding a large portion of your site‘s content, you shouldn‘t see any serious fluctuations in traffic or rankings.
That said, there are a few potential downsides to be aware of:
Reduced internal linking: Your homepage is often one of the most-linked pages on your site, so excluding a category here means those posts will have one less internal link pointing to them. This can slightly dilute your site‘s overall link authority.
Less exposure for excluded categories: If a category only appears on its archive page and nowhere else on the site, it may be harder for visitors to find that content. Consider adding key category pages to your navigation menu to compensate.
Ultimately, the SEO impact comes down to scale – hiding one or two categories is unlikely to move the needle, but excluding a large chunk of your content is riskier. When in doubt, a quick look at your analytics can tell you how much of your traffic comes from excluded category pages.
As for site navigation and user experience, it‘s actually quite common for WordPress homepages to show only a subset of categories. Think of major news sites, for instance – the homepage will feature top stories from a few key sections, not every article in every category.
The key is to be intentional about what you include and exclude, and make sure visitors still have clear ways to navigate to important categories. If you‘re using the excluded categories in your main navigation menu or sidebar, most users will still be able to find that content with ease.
Managing WordPress Categories Like a Pro

Excluding categories from your homepage is a quick way to declutter, but it‘s just one piece of the puzzle when it comes to WordPress category management. Here are a few more tips to keep your categories neat and tidy:
- Use clear, descriptive names: Avoid cute or clever category names that could confuse users. Stick to simple, obvious labels that accurately reflect the content.
- Keep your hierarchy shallow: If you need subcategories, limit them to 1-2 levels deep. A complex hierarchy is harder to navigate and manage.
- Don‘t go overboard: According to WordPress.com, the average site has 8 categories. Aim for a handful of high-level categories rather than dozens of hyper-specific ones.
- Consider other taxonomies: If you‘re using categories in a non-standard way (like for author bios or site announcements), a custom taxonomy or post type might be a better choice to keep things separated.
Of course, every site is different – these are guidelines, not hard and fast rules. The most important thing is to choose a category structure that makes sense for your content and your users.
Bonus: More Plugins to Tame Your Categories
If you really want to take your category game to the next level, there are a few more plugins worth checking out:
Category Tinymce: Lets you add a custom description to each category page using the WordPress visual editor. Handy for introductory text or navigation cues.
Category Order and Taxonomy Terms Order: Allows you to drag and drop categories into a custom order in the WordPress backend. The new order will reflect on the front-end, too.
WP Force Category Selection: Requires users to choose a category before a post can be published. Handy if your contributors are always forgetting to categorize their posts.
None of these plugins are strictly necessary for excluding categories from your homepage, but they can be helpful for keeping your categories organized as your site grows.
Wrapping Up
Phew, that was a lot of information! Let‘s quickly recap the key points:
- Hiding categories on your homepage declutters the page and creates a more focused user experience
- You can exclude categories with a plugin like WooCommerce Exclude Categories, or by adding a small code snippet to your site
- Excluding a handful of categories is unlikely to significantly impact your SEO, but be mindful of how it affects your site navigation and internal linking
- An organized category structure makes your site easier to navigate and manage over time
The good news is, you‘ve now got everything you need to hide unwanted categories from your homepage with confidence. No more announcement posts cluttering up your blog or product categories confusing your visitors. And if you‘re hungry for more category tips, there are some great plugins out there to automate and streamline the process even further.
So what are you waiting for? Go forth and declutter that homepage! And if you have any other clever tips for managing WordPress categories, I‘d love to hear them – share away in the comments.
