How to Hide Posts on Homepage of the WordPress Website

WordPress is versatile. By choosing themes, installing plugins and manually fiddling with code and templates, you can develop any type of website that you want. The style of the homepage depends solely on the theme and your wishes. But even though it has been years after WordPress evolved into much more than a simple blogging platform, it’s hard to grow outside the original idea.

That is why most of the websites built with WordPress still show new blog posts on the homepage. Most of the users will want their new articles featured on the front page, so there is a reason why most of the themes come designed in such a way.

When you get comfortable enough with writing posts in WordPress and learning how the editor works, you will realize that it is easy to make specific posts sticky. But at the same time, it will look impossible to remove particular posts from the homepage. Is it possible to hide posts on homepage?

Why would someone hide posts from the homepage in the first place?

For most bloggers, hiding posts may seem ridiculous. Why would anyone spend time writing new articles and then decide to hide them from the homepage? Well, there are different reasons for hiding posts.

For example, you may have several categories for organizing content. So, you might want to show just one category on your homepage and hide other ones from the public. If you write both reviews and short news, maybe you will want only reviews to be displayed to the new users while you can show the news somewhere else. A good example would be having a news category that you only want to display in a slider. So, hiding posts from homepage would make sense – you would avoid having duplicate content on the homepage.

Another example where users would like to hide posts is having guest posts. Instead of featuring guests on the homepage, you might want to show guest posts just on a special page instead. There are hundreds of reason why would someone hide posts from the homepage, and yours might completely unique.

How to hide posts from the homepage

Unfortunately, WordPress does not feature this option. It would be nice if there were a checkbox that would let you hide the post from the homepage even before publishing it, but instead, you will have to consider different methods. Don’t worry, though; there are some popular and free plugins that will solve your problem in a jiffy.

Make the post private

But before we get to those nifty extensions, here’s a more straightforward solution. If you just want to make a private post that will be available just to logged in users, there’s no need for installing additional plugins.

Make private post in WordPress

When writing a new article, take a look at the right-hand side of the screen where you will find publishing options. From there, you can change the visibility to Private which will hide the post both from the homepage and direct access. Only administrators and editors will get to see such private posts. If you are still not well acquainted with post options, please see how to publish your first WordPress post and learn about all the default options.

Create pages instead

Although there is an unwritten rule that tells not to write articles as pages, there are always exceptions. Depending on the structure of your blog and the overall organization, you might hide specific posts just by publishing them as pages.

Since most of the WordPress themes grab only the latest posts for the homepage, writing an article as a page will let you go around that. Add a new page, write whatever you wanted and publish the content. But as you can see, your new article won’t be listed anywhere else on the site. That’s why you have to have an organized site for this to work and plan a solution that will let you display pages somewhere else.

We already talked about adding pages in WordPress, so please click the link to learn about all the options.

WP Hide Post

PRICE: Free

WP Hide Post

This free WordPress plugin counts more than 50,000 active users and is regularly updated. WP Hide Post is very simple; it lets you control the visibility of a post in various places like the front, category, tag, authors, archive, search results, and feed pages.

Since the plugin works both with posts and pages, you have a complete control. WP Hide Post does a great job hiding your posts and pages, but there’s much more power into it. Because of the main feature, you get to write posts that can help you with search engine optimization while at the same time keeping a clean structure of the site.

In order to hide posts and pages from the homepage, follow these simple steps:

  1. Go to Plugins -> Add New
  2. Search for “WP Hide Post”
  3. Install and activate the plugin
  4. Create a new post or edit an existing one
  5. On the right-hand side, find the “Post Visibility” box created by the plugin
  6. Check the option to hide that specific post

As long as you don’t check boxes from the new Post Visibility box, the post will appear as usual.

Hide all posts from specific categories

While the previously mentioned plugin will solve almost all of you post-hiding problems, it can’t hide entire categories. So, there’s a different approach you can use to hide posts from a specific category.

Instead of installing plugins, this time you will have to get your hands a bit dirty on the code. Before you start modifying template files, please see how to work with the Appearance Editor in WordPress.

If you know the risks of editing the code and you know what you are doing, feel free to proceed. Otherwise, if you’re not sure about Appearance Editor and PHP, we advise not to continue:

  1. Go to Posts -> Categories
  2. Click and open the category that you want to hide
  3. Check out the URL that is shown in the browser
  4. Somewhere in the middle, you should see something like this: “/term.php?taxonomy=category&tag_ID=55&post_type=post”
  5. Remember the ID number of the category (in this case, the number is 55)
  6. Open functions.php file from the active theme
  7. Copy and paste the code and replace “xx” with the category ID (leave the minus sign in the code)

function exclude_category($query) {
if ( $query->is_home() ) {
$query->set( 'cat', '-xx' );
}
return $query;
}
add_filter( 'pre_get_posts', 'exclude_category' );

Once you save changes, all posts that are part of that particular category will no longer appear on the homepage. Now, instead of using the plugin to manually hide each and every post or page, you just have to add the post to the selected category, and WordPress will work out the rest.

If you ever decide to bring back the category on the homepage, just go back to the functions.php file and delete the code.

Ultimate Category Excluder

PRICE: Free

Ultimate Category Excluder

If you prefer excluding entire categories from the front page by using a plugin, Ultimate Category Excluder is the one you are looking for. Right after installing this free plugin, you will be able to select categories that you don’t want on front pages, archives, feeds, and searches.

The plugin is simple as it gets, and there are more than 30,000 active users to prove you that it works well.

Conclusion

Whatever the reason you have for hiding WordPress posts from the homepage, this article should have helped you to do so. Although there are several methods available, we suggest using the free WP Hide Post plugin that will solve your problem in a matter of seconds.

If you are familiar with WordPress templates and editing functions.php file, you can achieve pretty much the same results without using a plugin.

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

2 thoughts on “How to Hide Posts on Homepage of the WordPress Website

  1. Hello, I want to hide a specific post format (images) from my homepage. How would I achieve that? Wp hide post works but I have to check the box for every image…is there a lighter, more convenient way?

    • If you assign a unique category to that post format, you can hide the entire category with a plugin or by placing the code – check the article again for more info about both methods.

Leave a Reply

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