Ok so this way is a bit long but it will get the job done.
We can use multiple meta_value checks with AND relation
// get posts
$posts = get_posts(array(
'post_type' => 'post',
'posts_per_page' => 150,
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'usp-custom-1',
'value' => 'question',
'compare' => '!=',
),
array(
'key' => 'usp-custom-1',
'value' => 'money',
'compare' => '!=',
),
array(
'key' => 'usp-custom-1',
'value' => 'health',
'compare' => '!=',
),
array(
'key' => 'usp-custom-1',
'value' => 'relationships',
'compare' => '!=',
),
),
'author' => $_GET["id"],
'order' => 'DESC'
));
You need to check the performance hit for this query because it can be resouce heavy.
I alos noticed $_GET["id"]
, you passed it raw, I would suggest sanitizing/validating every value that was passed to you (values that you did not pass yourself, like user input or url queries).
By the property name I assume that it will be a id, so we can sanitize it like this
'author' => filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT)