Run cronjob with browser request
You’d be better off using the wordpress API: function wp_register_cron_endpoint() { register_rest_route( ‘crons’, ‘/run_cron’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘run_crons’ )); } add_action( ‘rest_api_init’, ‘wp_register_cron_endpoint’ ); function run_crons(){ /*** Do whatever you want ***/ } Then you can hit http://example.com/crons/run_crons and you’ll A)Trigger wp_cron based on the wp_load and B) Do whatever you want … Read more