I'm trying to figure out how I can utilize WP_Query and WP_Meta_Query outside of the WordPress install, for server Cron jobs.
I've tried including
wp-load.php but this also brings in plugins like WooCommerce into the mix and I'm getting all kinds of header warnings, etc. I just need to be interacting with the database, not all of the theme and plugin methods.
This is an example of the warnings that I currently get:
Notice: wp_woocommerce_session_d34eac23ade02d0820a9089e923eed79 cookie cannot be set - headers already sent by /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-content/plugins/woo-product-slider/main.php on line 214 in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 733 Fatal error: Cannot redeclare get_query_var() (previously declared in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-includes/query.php:26) in /var/www/vhosts/mywebsite.com/dev.mywebsite.com/wp-includes/query.php on line 29