November 15, 2017
A handy snippet that can be used in conjunction with Advanced Custom Fields as well as the WordPress default custom fields to remove Posts, Pages and Custom Post Types from feeds.
$args = array( 'post_type' => 'contributor_ad', 'posts_per_page' => 6, 'order' => 'DESC', 'meta_key' => 'expiry_date', 'meta_query' => array( array( 'key' => 'expiry_date', 'value' => $today, 'compare' => '>=', 'type' => 'DATE', ) ) ); $contributor_ad = new WP_Query($args);
Note: This does not update the content, or change the Post Status.