Filters are for modifying data that's passed through them. You need to take the input, modify it, then `return` it. function exclude_not_allowed_terms( $args ) { if(!current_user_can('edit_others_posts')) { $args['meta_query'] = array( array( 'key' => 'owner', 'value' => get_current_user_id() ) ); } return $args; } add_filter('get_terms_defaults','exclude_not_allowed_terms');