specify $form elements to be excluded from display?
Using unset() isn't a good solution for forms (as I think you know), as you never know what submit/validate handlers might be expecting the unset element to exist when they're processed. This can lead to unwanted errors.

There are three methods you can safely use to 'hide' a form element


Use '#type' =&gt; 'value' on the element, which will have the effect that the value for the element will still be passed through to the submit/validate functions with its #value as normal. This is my preferred method.
Use '#access' =&gt; FALSE on the element to denote it should not be outputted to the screen.
Use '#type' =&gt; 'hidden' as Bart has suggested (although use of this depends on your use case; I imagine if you're trying to hide the value of a form element you don't want to output it in the form as a hidden input).