- Make sure you have the required WP_CLI::add_comand() line configured in your plugin/theme
- Install and configure the WP CLI app:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /var/www/vhosts/yoursidefolder/wp-cli.phar - Test command. Eg.: /var/www/vhosts/yoursitefolder/usr/bin/php /var/www/vhosts/yoursidefolder/wp-cli.phar –path=/var/www/vhosts/yoursidefolder/httpdocs <action_name> <action_method>
- Add the cron job to your server’s config