1

Recently I bought a small package of VPS to start working on a website. To make server configuration stuff easy, I installed VestaCP. I have installed WordPress on the server, then the necessary theme and plugins.

A plugin of the website needs to fire scheduled/cron work on every 5 minutes. The problem is the scheduled jobs from the plugin are not running, though the site on a cPanel based VPS is working.

I want to know what configuration needs to update in my VPS to make the server run scheduled work from the WordPress plugins?

1 Answer 1

1

I'd guess this is because your new website isn't getting any traffic.

By default WordPress doesn't have any background processes to run scheduled jobs on, and instead runs them when it next gets a web request after the scheduled start time. Hence it needs a constant stream of web traffic to run scheduled jobs on time. See Cron in the WordPress documentation.

To fix this, you can set up a scheduled job using the VPN's system cron to trigger WordPress's cron jobs. Again from the WordPress documentation: Hooking WP-Cron Into the System Task Scheduler, e.g. cron configuration

*/5 0 * * * wget --delete-after http://YOUR_SITE_URL/wp-cron.php

If you have many long-running jobs there are also plugins that will run WordPress scheduled tasks in a separate service for you.

1
  • I am constantly browsing the site for testing, So, I guess lack of traffic will not the cause.
    – Shah Alom
    Commented Aug 30, 2020 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.