Improve wordpress performance on Azure by disabling WP_CRON and using Azure webjobs

First of all, if you don’t use the SCM/Kudo dashboard for your azure web sites then your missing out. It allows so much management straight from the browser. Access to commandline, file editing, process explorer and so much more.

To access it:


For editing files, this is really easy, just then append /dev/[PATH TO FILE]. So for editing the wp-config.php we can just browse to:



Disable WP_CRON

To disable the built in wordpress cron, which runs on each page load, just add

define(‘DISABLE_WP_CRON’, true);

Adding an Azure web job

We now need to schedule azure to run the WP cron manually at a set interval. For this we need the path to the wp cron file, which is on Azure:


We then need the path to the php.exe which is:

“D:\Program Files (x86)\PHP\v7.0\php.exe”

We are the going to put them together to create:

“D:\Program Files (x86)\PHP\v7.0\php.exe” D:\home\site\wwwroot\wp-cron.php cli/auto

Testing in Debug Console

You can try this out by going to the command promt for your azure site, using, the SCM dashboard!


If there are no errors after pasting it in and pressing enter then its run your cron jobs successfully!

Create a batch file

We now need to create a .bat file to upload to the web job, in note pad just put in:

“D:\Program Files (x86)\PHP\v7.0\php.exe” D:\home\site\wwwroot\wp-cron.php cli/auto

and save as “wordpresscron.bat”

Adding the Job

Navigate to web jobs in the azure portal for the web app


Then click Add. You need to specify:

Name – add a nice name

File to upload – select the bat file just created

Type – Tirggered

Triggers – Schedulef

Cron Expression – agh! What to put in here?.. This is where we set how often we want it to run. More on this in a second.

Building a CRON expression

A CRON expression is a measure of time. For example, I want to run this every five minutes, so my cron expression is:

0 */5 * * * *

The best thing to do is use a cron expression builder web site, I quite like . More on CRONS at

Put it all together and then click OK.

Your CRONs are now optomised for wordpress on Azure!



Tags: , , , , , , ,

No comments yet. Be the first!

Leave a Reply

Get in touch