Using WP_Query and WP_Meta_Query Outside of WordPress
This is what worked for me: require_once ‘wp-config.php’; global $wpdb; $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, ); $Query= new WP_Query($args); You can use similar way to achieve what you want.