Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

ShopOrderQuery

// WP_Query arguments
$args = array(
	'post_type'              => array( 'shop_order' ),
	'date_query'             => array(
		array(
			'before'        => '2024-06-01',
			'after'         => '2024-05-01',
			'inclusive'     => true,
		),
	),
);

// The Query
$query = new WP_Query( $args );