You will have to walk/map/filter the array before printing them. There’re plenty of array_*()
functions provided by PHP for that. Example:
$custom = get_post_custom();
// Remove all strings starting with `_`
array_filter( $custom, function( $data, $name ) {
return "_" !== substr( $name, 0, 1 );
}, ARRAY_FILTER_USE_BOTH );
foreach ( $custom as $field )
var_dump( $field );