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 Exclude From Homepage Plugin

The easiest way to exclude posts from the homepage is of course using a plugin (if your homepage is setup to display latest posts). One of the currently best rated plugins for this is called WP Exclude From Homepage which allows you to exclude categories, tags, posts of even pages from the homepage without breaking pagination. You can learn more about the plugin here.

Use WP Hide Post Plugin

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.

  • Published on:
  • Last Updated on:
  • Posted Under: WordPress Tutorials
Tom Ewer
Post Author: Tom Ewer

Tom Ewer is a professional blogger, longtime WordPress enthusiast and the founder of WordCandy.

Disclosure: This page contains external affiliate links that may result in us receiving a comission if you choose to purchase said product. The opinions on this page are our own. We do not receive payment for positive reviews.
Got something to say? Join the discussion.
  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!
  3. Shweta says:
    Thanks for the help, Tom! This very effective. We just used WP HidePost on our site. Cheers! :)
  4. Praveen says:
    Hey Tom, Thanks a lot you just saved my Event from the scrapper. I don't know how a spammer used my feed and published all articles on his site. Google considered my all post copied and penalized me. But after use of this plugin I can focus on my Event :) Thank you very much :)
  5. bronsonoquinn says:
    Thanks so much! I was having problems, but I figured it out: the second to last apostrophe (the one before 'exclude_category') is actually not an apostrophe but a strange symbol. I switched it to an apostrophe and that worked. One question I had, though, was how do I do this in a child theme? I tried copying the functions.php file into the child directory, but that wouldn't work. It only worked when I overwrote the original functions.php file in the original theme. (I'm using Twenty Fifteen; don't know if that helps)
    • AJ Clarke says:
      AJ Clarke
      Thanks for the heads up, I fixed the code ;) You should create a new blank functions.php file in your child theme. Here is an example child theme I use for my Total WordPress theme so you can see how a child theme should be setup. Basically your child theme should have a functions.php file already (for loading the stylesheet) and you would add this code right under that.
      Admin
  6. herautama says:
    Thanks for the info, I am currently want to hide a category from my blog not to appear on front page
  7. bknewhaven says:
    What I would like to do for my wife's site is ideally have all posts on a hidden page, then make a menu that contains categories only. This way she can write posts, but they would only appear automatically on the page related to that category. If that makes sense?
  8. Amresh Singh says:
    I used WP hide post for a long time, but recently realized it was making my site slow. I don't know why. I'm considering writing my own code, just need to learn a bit of PHP.
    • AJ Clarke says:
      AJ Clarke
      Hum, I don't see why it would slow down the site, but thanks for the heads up! If this is the case, hopefully it helps others. Have you reported the issues to the plugin developer? Hopefully if it is a plugin issue there is an easy fix.
      Admin
  9. scqlhr says:
    It's fine if you are on wordpress.org or com/premium. Regular wordpress.com users aren't allowed to upload plug ins. Too bad.
  10. fpulseaid says:
    Hi, I've downloaded and installed the plugin. Hide the post from homepage but it's still there. My site: fpulseaid.com . The article is under health and beauty. How do I remove it from the homepage? Do I need to create a page for the 'Home'?
    • AJ Clarke says:
      AJ Clarke
      Please have a look at the recommended plugins in the article, the first plugin can be used to exclude categories such as health/beauty in your case from the homepage.
      Admin
  11. pdizzywizzy says:
    I am so happy to have found this post! I have been looking endlessly to accomplish this task. Thank you for the great explanation. This solves a big issues I've been having, but I was wondering if it is possible to hide posts from the homepage as well as make that same post "sticky" on the other page it will be seen on?
  12. Cami Graham says:
    I was wanting to hide all my link parties each week. I hope this will do it. Thanks so much!
  13. Sarah Adams Attah says:
    my reason for hiding post is to prevent my blogger friends from copying my latest articles before i share it myself . Thanks a lot
  14. Mistie @ Homespun Engineer says:
    This worked great and really solved a problem I thought was going to be a huge hassle. Thank you so much.
  15. Canada to France says:
    I have to tell you I searched up and down for a way to do this - all I could find were query this and that BS and while I am a complete nerd, querying post from my theme was not an option - 3 hours i WONT get back. Your solution took me 5 minutes, much appreciated!

Leave a Reply