V4 - How to create Wordpress manual cronjob?

Hi,

On my Wordpress websites I prefer to run manual cronjobs so I always add to config.php the DISABLE_WP_CRON constant set to true (define( ‘DISABLE_WP_CRON’, true ):wink:

My question is how in EE v4 can I using SSH add an automatic cronjob that runs once a day at 23:00h? Because of Docker do I need to do anything different when comparing to a “normal” server?

Thanks

Just found the docs about this: https://easyengine.io/handbook/cron/ but I don’t know what command to use for Wordpress cron. Is it something like this:

ee cron create mydomain.com --command=‘wp-cron.php’ --schedule=’@daily

Any help is appreciated. Thanks

@mikeslv You almost got the answer. For running WordPress cron, you need to run this command as a cron job

wp cron event run --due-now

as given here https://easyengine.io/commands/cron/create/#examples

1 Like

Hi @mriyam.tamuli

Thanks for the info. So you are saying that the command bellow executes the Wordpress wp-cron.php file, correct?

wp cron event run --due-now

If yes, and just to be sure, if I want to run a hourly Wordpress cron on my website domain1.com I will have to run the command, correct?

ee cron create domain1.com --command='wp cron event run --due-now' --schedule='@hourly'

Thanks!

1 Like

That is correct :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.