admin管理员组

文章数量:1325674

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?

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?

Share Improve this question asked Aug 30, 2020 at 10:36 Shah AlomShah Alom 4981 gold badge5 silver badges14 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: Cron jobs not working in WordPress plugin in a VPS with VestCP control panel