Woman Working on a Server
Hero Section Background

How to replace WordPress cron with real cron jobs on Plesk

Matt Campbell | WordPress Tutorials

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

OptionValue
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.

Get In Touch

Please submit your query & a consultant will get back to you.

Please make sure all required fields are completed.

Budget

£1000

Thanks for your message

A consultant will contact you shortly!

Related Articles

Site Speed Surprises Two Men Holding Laptops
28 May 2019

Why is Site Speed & Page Load Time Important?

Site speed in today’s world is more important than ever before. With super fast internet speeds and more choice than […]

Roomiematch Lower Homepage on Laptop
17 May 2019

What are the key factors of good web design?

As this article is about the effectiveness of good web design, we won’t be talking too much about what design […]

Scraptastic Club Shop Page on iMac Banner
03 Apr 2019

Who to hire – freelancer, agency or employee?

When it comes to planning a new project, the biggest hurdle to overcome is hiring the right people. What you’re […]

Free Email Updates
Get the latest content first.
We respect your privacy.