How to Hide Posts on Your WordPress Site’s Home Page

How to Hide Posts on Your WordPress Site’s Home Page

Most WordPress themes are set up so that your latest blog posts appear on the front page of your site. Or, if you have a static home page, your newest entries appear on a dedicated page. Regardless of how these posts are displayed — in a list, in a tiled view, or what have you — one thing remains the same: the newest posts appear first.

But what if you don’t want your newest blog post to have such a prominent position? Believe it or not, this is actually a fairly common desire from bloggers in every industry. Let’s take some time now to explore some reasons why bloggers want to hide posts in the first place and how to accomplish this task quickly and easily.

Why Hide Posts?

There are a number of reasons why someone would want to hide a post from his or her home page. For starters, your blog might offer a variety of types of posts from brief news pieces to more in-depth tutorials. The latter make for more appealing posts to appear on a home page because they are always valuable and not time-sensitive. Plus, if you don’t update your blog super frequently, emphasizing your high value content over news makes your site more relevant on a consistent basis.

Maybe you’ve recently written a post on a controversial topic and don’t want that to be the first thing your visitors see. This is understandable as you wouldn’t want to detract from other, perhaps more relevant, posts. Or maybe you only want to feature posts written by you and not guest bloggers. Or maybe you only want posts from a certain category to appear. The reasons are diverse. What’s important is you can make this simple change pretty painlessly. And you have a couple of options to get it done.

Consider Creating Pages

This requires some planning ahead of time but it’s by far the simplest method to prevent certain posts from appearing on your blog’s home page — don’t make it a post at all.

Instead, create a new page and post your content there. You can then select where you want this page to appear. You can opt to not have a link on the home page to this page if you’d like by modifying your menus. Just don’t list the page in the menu as a link and all should be fine. Quick and painless.

Again, this only works if the content in question hasn’t been created yet and you don’t anticipate needing to do this very often. Still, it’s an easy fix.

Use WP Hide Post

WP Hide Post

Now, if you’ve already created content as a post and don’t want it to appear on the home page you can accomplish this by installing a plugin. WP Hide Post is a great option because it’s simple and accomplishes this one task in a straightforward way.

Once installed, you’re provided with a number of options in terms of post visibility right from within the post editor:

WP Hide Post options

You can opt to remove the post from your site’s home page. You can also remove it from applicable category pages, tag pages and archive pages. You can even select the option to prevent a specific post from appearing in site-wide search results as well as on dedicated author pages. It’s up to you.

You can hide the post in question in all of these ways or just from the home page. In every other place you don’t select, the post will appear as normal with normal linking structure and everything. That is, it will still have a standard permalink and will be included in the sitemap. This means it’s still searchable via search engines and will appear in those results but it won’t appear at the top of your site. This can also be helpful when you’re creating exclusive content for your readers and you plan on only providing access to it by means of a direct link.

As a side note, this plugin can be used to hide pages as well. You have the option of hiding them from the home page or from anywhere else on the blog including in site-wide search.

Hiding Posts from RSS Feeds

WP Hide Post can be used to hide posts from showing up as published in your RSS feed as well.

Again, you may wish to do this if your intent is to create posts that act as resources that don’t fit in with your blog’s main style or focus (but you’d still like to rank for in terms of SEO) or if you write posts on occasion that are off-topic and don’t want available to readers as the first thing they see when visiting your site.

To do this, all you have to do is check the box that says “Hide Feeds” on the righthand side of the post editor once the plugin is installed.

Manually Hiding Categories

If you want to hide an entire category from your home page, you can do this using the WP Hide Post plugin discussed above or you can manually add a bit of code into your theme’s functions.php file to enact the same effect.

There’s a nice tutorial on this at Locoed Web Development. Remember to back up your site before modifying theme files like this. Basically, you create a dedicated category for the posts you want to hide, jot down the category ID, then paste the following bit of code at the end of the file right before “?>” and replace the “xx” with the category ID:

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

This bit of code will prevent your chosen category from showing up on your site’s home page, which can be useful if you plan on offering multiple channels of content on a regular basis and don’t want one of them mixed up with your site’s main content.

Conclusion

With the ability to hide certain posts from your WordPress site’s home page in your developer’s tool belt, you gain the freedom to create more of the posts you want to make without cluttering up your site. You no longer have to fear making a commentary on a hot subject or creating more content with SEO in mind, since your home page will remain exactly as you want it to.

Do you hide certain posts from your site’s home page? If so, why? Also, what tools do you use to accomplish this? We’d love to hear your feedback.

Tom Ewer
Tom Ewer is the editor of the ManageWP Blog and a blogger for hire.
Tom Ewer
This article has 3 comments
  1. Abrar Mohi Shafee says:

    Thank you very much for the exciting post. I was exactly looking for this. However, I tried a few methods but didn’t work. But this time it works. So thanks a lot.

  2. Lisa O’Neill says:

    Really useful- just what I am looking for after installing a slider using posts!

Leave a Reply