Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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.