Get post ids from WP_Query? April 4, 2022 by Tarik Billa Try $post_ids = wp_list_pluck( $latest->posts, 'ID' ); Read wp_list_pluck