WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anyway of telling wordpress, by some plugin or whatever, not to show Recent news from Category X, on my home page?

Or I may do it only by modifying the home.php code?

share|improve this question
This is a theme issue. Post the code for the page. – s_ha_dum Jan 6 '13 at 17:34
@s_ha_dum thought so, if it's a theme issue I know what I have to do... I was just wondering if there is any alternative – w0rldart Jan 6 '13 at 17:38
up vote 1 down vote accepted

Assuming this is the default main query, see the example for pre_get_posts, which shows how to exclude a category from the main query:

function wpa78465_exclude_category( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
        $query->set( 'cat', '-1,-1347' ); // IDs of categories to exclude
add_action( 'pre_get_posts', 'wpa78465_exclude_category' );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.