Woman Working on a Server
Hero Section Background

How to replace WordPress cron with real cron jobs on Plesk

The following is a step-by-step guide to replacing WordPress cron jobs on Plesk. When you have finished, WordPress scheduled actions will run reliably and efficently thanks to being triggered by a real server cron job.

By default, WordPress cron relies on someone visiting the site to be triggered. As such, scheduled actions only run if the site has traffic. The flip side of this is that it runs every time a visitor hits the site.

Disable default WordPress cron

Before setting up the server to run the scheduled actions, we need to stop WordPress’ default cron system. We do this by defining DISABLE_WP_CRON as TRUE in our wp-config.php file.

Step 1

Log in to your Plesk admin panel and go to the site you want to setup real cron for.

Step 2

Go to the File Manager and navigate to the site’s root directory that has wp-config.php in it and open the file.

Click the link to get to the File Manager & wp-config.php

Step 3

Open up the file wp-config.php in the File Manager to make the alterations.

File Manager wp-config Highlight

Below the line that says

define('WP_DEBUG', FALSE);

Add the following PHP code snippet

define('DISABLE_WP_CRON', true);

So your wp-config.php looks like

define('WP_DEBUG', FALSE);

define('DISABLE_WP_CRON', true);

WordPress cron will no longer try to trigger the scheduled actions list when visitors are active on the site. We can instead configure our Plesk server to do this for us.

Setup Plesk to trigger WordPress cron jobs

Now we can give our Plesk server the duties of running the WordPress scheduled actions.

The process to getting Plesk to run WordPress cron jobs is quite simple and it’s a single command in Plesk’s scheduled tasks system.

Step 1

Go back to your domain’s main control panel in Plesk. In the sidebar, look for the Scheduled Tasks link and go to it.

Plesk Scheduled Tasks Link Location

Step 2

Click Add Task. This will open up the Scheduled Tasks control panel where we will create our cron job.

Step 3

Fill in the form with the following settings

Task Type Select Run a command
Commandwget -q -O – http(s)://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

RunSelect Cron Style from the drop down and then enter * * * * *
DescriptionMemorable name for the cron job, specific to your domain.
NotifyIt’s always a good idea to select the Errors Only option so you’re made aware of any issues in running the cron job
Example WordPress Cron jobs on Plesk

Step 4

Click OK and make sure it saves correctly. The Plesk Scheduled Task will now appear in the domain’s and server’s lists of scheduled tasks.

Testing Plesk is running WordPress Cron Jobs

So, now you’ve got Plesk setup you need to see if it’s working right? To do so, we can use the awesome Advanced Cron Manager – debug & control plugin. It’s free and on the WordPress Plugin repo so all you need to do is add it to your site from the WordPress admin area.

Upon installation, open the Tools menu and navigate to Cron Manager. You’ll be presented with a list of all the scheduled actions for your site and when they’re going to run.

Now, sit back and relax while we wait for the next action to run. If it moves off the top of the list at the time it’s meant to run…everything is working!

That’s it!!! You have successfully replaced WordPress cron jobs with Plesk cron jobs that trigger WordPress scheduled actions.

Need some help setting things up? We’d be more than happy to help. Just drop us a message via the form below.

Related Articles

Discussion over a pie chart
16 Aug 2019

Digital Marketing for Zoos White Paper

Today, we would like to announce we are producing a white paper on Digital Marketing for Zoos. Our objective is […]

Microsite being designed on laptop
29 Jul 2019

Microsites – What Are They And Why Use Them?

A website is ever evolving. It needs to change and adapt as the business grows and online demands change. This […]

Drawing Website Features
17 Jul 2019

What Features Should Every Zoo Website Have?

The zoo sector is one we’ve loved working in since 2017. Thanks to our time with Houston Zoo, we’ve learnt […]