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

I'm trying to edit a wordpress theme.

The following is the section of code where the list of categories is retrieved and displayed in a drop-down menu.

<label for="entrycat">* <?php _e( "Question category:", "sofa_qanda" ); ?></label>
$select = wp_dropdown_categories( 'show_option_none=Select&show_count=0&orderby=name&echo=0&hide_empty=0' );
$select = preg_replace( '|<select(.*?).*?>|i', '<select id="entrycat" name="entrycat" tabindex="4">', $select );
echo $select;

I what to exclude a particular category, say category id 10 from the list. How do I do that?

share|improve this question
up vote 2 down vote accepted


use the 'exclude' parameter; example:

$select = wp_dropdown_categories( 'show_option_none=Select&show_count=0&orderby=name&echo=0&hide_empty=0&exclude=10' ); 
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.