widget exclude post by custom field

The meta_query parameter in WP_Query allows you to query posts that don’t have a certain custom field. Furthermore, you can check for multiple custom fields. With two queries in meta_query, you can fetch all posts that either don’t have a custom field, or have it set to 0:

'meta_query' => array(
    'relation' => 'OR',
    array(
        'key' => 'my-key',
        'value' => '0'
    ),
    array(
        'key' => 'my-key',
        'compare' => 'NOT EXISTS',
        'value' => 'Use any value here' // If you're using WordPress 3.9+, you can omit "value" for NOT EXISTS
    )
)