Tips on WordPress wp-cron.php

WordPress runs jobs such as scheduled posts, backups and emails through wp-cron.php. By default this check runs on every visit. Setting up a real scheduled task (cron) both speeds up the site and makes sure jobs run on time.

In short
  • Turn off WordPress's own cron in wp-config.php.
  • Add a task in Plesk that runs wp-cron.php every 5 minutes.
  • Optionally block outside access to wp-cron.php.

Why does the default wp-cron cause problems?

  • Performance: On busy sites, the check on every page load puts unnecessary load on the server.
  • Timing: On sites with few visitors, scheduled posts are published late and backups do not start.
  • Security: wp-cron.php can be called repeatedly from outside to slow your site down.

1. Turn off WordPress's own cron

Add this to wp-config.php above the /* That's all, stop editing! */ line:

define( 'DISABLE_WP_CRON', true );

2. Add a scheduled task in Plesk

  1. Log in to your Plesk panel at https://yourdomain.com:8443 or from the service page in your client area.
  2. On the Websites & Domains page, click Scheduled Tasks and choose Add Task.
  3. Choose Run a PHP script as the task type and select httpdocs/wp-cron.php as the script path. Choose the PHP version your site uses.
  4. In Run, choose Cron style and enter */5 * * * *. The task runs every 5 minutes.wp-cron.php in the Plesk scheduled task form
  5. Click OK. To test the task right away, use Run Now in the list.

If your site's settings in WP Toolkit have a Take over wp-cron.php option, Plesk does these two steps for you. General information on scheduled tasks: How to create a cron job

3. Block outside access (optional)

After setting up a real cron, you can block outside calls to wp-cron.php with .htaccess. The Plesk task is a Run a PHP script task, so this rule does not affect it:

# wp-cron.php cannot be called from outside
<Files wp-cron.php>
  Require all denied
</Files>

If you set up the task as Fetch a URL, do not add this rule; the task would be blocked too.

Need help? Open a support ticket from your client area or call +90 216 348 35 03.
  • 0 Users Found This Useful
  • wp-cron.php düzenleme, wordpress
Was this answer helpful?

Related Articles

Which Operating System Should I Choose for Hosting? (Linux or Windows?)

The right operating system depends on the software your site runs on. Choose Linux for sites...

Where Do I Manage My Email Accounts?

You manage your email accounts in your hosting control panel. Creating accounts, changing...

What Is a Subdomain and How Do I Create One?

A subdomain is a separate address added in front of your domain. For example, for yourdomain.com...

Do You Support ASP and ASP.NET?

Yes. webevi Windows hosting packages come with ASP and ASP.NET support, and you can also use...

Can I Host Any Kind of Website with webevi?

You can host any website on webevi servers that complies with the law and generally accepted...

Powered by WHMCompleteSolution