• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Maroon Technology Ltd.

Maroon Technology Ltd.

Web Strategy with Perspective

  • Can We Help?
  • Services
  • Hire Us
  • About Us
  • Blog
  • Contact Us
  • Show Search
Hide Search
You are here: Home / WP Code Snippets / Don’t Display Specified Category or Categories on WordPress Blog Page

Don’t Display Specified Category or Categories on WordPress Blog Page

Terry · Nov 18, 2019 ·

Updated: 19 Nov 2019

Someone asked on the StudioPress forum about filtering specific post categories from display in the blog page.

There have been changes to how WordPress custom fields can be used on a page with Gutenberg, as well as changes to interfaces the Genesis framework provide for Blog display and filtering.

The approach shared below involves adding code to your functions.php file and uses a WordPress action hook. If you’re comfortable changing code in your functions.php file, keep reading. If not, you may want to phone a friend who is (or hire a dev for this quick project).

This addition to your functions.php file will allow certain categories to be excluded from your blog page:

Note that it works whether your blog is located on the home page or on a Posts page. The reason why is in how WordPress terms front_page & home_page. A topic for another day.

Because there’s always more than one way to do anything… You could also filter your posts on the Blog or Home page this way:

To learn how to find your WordPress category ID to use visit here.

Hope that helps to make your day easier.

WP Code Snippets

Footer

Perspective that Results in Delight

  • It's the marriage of content, art and technology to craft a message your customer can digest.
    words.art.technology
  • It's a journey for you, our client, with a route, milestones & a destination.
    controlled.accountable.easy
  • It's Maroon guiding the journey - understanding what's possible, what works & what doesn't.
    effective.delightful.done

Updates from Maroon

  • *
  • This field is for validation purposes and should be left unchanged.

Recent Posts

  • WordPress 5.5 Released
  • What Is Captcha or Recaptcha and Why Do My WordPress Website Forms Need It?
  • Don’t Display Specified Category or Categories on WordPress Blog Page
  • Genesis 3.0 release

Connect with Us

  • Email
  • Facebook
  • RSS
  • Twitter
  • Home
  • Terms of Use
  • Privacy
  • Contact

Copyright © 2021 · Maroon Technology Ltd · All Rights Reserved

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy