Skip to main content
All CollectionsWordPress Plugin
What does the speed of the audit depend on?
What does the speed of the audit depend on?

The article explains what factors influence the speed of the audit

Anna avatar
Written by Anna
Updated over 2 years ago

The content audit runs in two modes: quick audit and background audit. What does it mean?

Quick audit

The fastest way is the simplest: just open the Content audit page in your browser and leave it open until finished. The page periodically sends requests and triggers audit execution at your site side. We analyze each page in 12-15 seconds in this mode.

An indication that the audit is running is the progress bar in the right corner of the plugin page.

Background audit with WP-Cron

When no page is opened in the browser the plugin runs an audit in the background using WordPress' scheduling system: WP-Cron. WordPress has a number of tasks that require periodic execution: checking for updates or publishing scheduled posts. WP-Cron is a universal way to run periodic tasks and it works on any WordPress installation by default. The wp-cron.php triggers on any frontend or backend page loads. It checks a list of tasks and runs the queue of pending tasks.

But WP-Cron can not guarantee that tasks will be run in the desired time.

This mean 2 facts:

  • At low traffic sites scheduled time can be missing, tasks run only when someone loads a page.

  • At high traffic sites the WP-Cron calls on every page load and can create performance issues.

So as a result, the background audit with WP-Cron can potentially take a very, very long time.

Fortunately the alternative way exists: system scheduler. We recommend switching to the system cron whenever possible, though some shared hosting services usually do not provide access to the system scheduler. In that case WP-Cron is the only way to run scheduled tasks.

Background audit with system cron

It is possible to switch WordPress to use native cron and do not trigger WP-Cron on each page load. There are two steps:

  1. Hooking WP-Cron Into the System Task Scheduler.
    What exactly you need to do depends on the installed OS (Linux, MacOS, Windows) or available web hosting control panel (cPanel) at the server.
    Generally you need to schedule wp-cron.php periodically from your server.

  2. Disable WP-Cron run on each page load.
    Edit wp-config.php file and add the line:
    define( 'DISABLE_WP_CRON', true );

You can find detailed instructions on how to switch to system cron in WordPress.org article.

Background audit speed

The content audit task execution is scheduled once per 3 minutes by default. It will run when WP-Cron or system cron triggers an execution.

You can open plugin settings (Ahrefs SEO / Settings / Audit schedule / Delay between requests) and choose the interval from 1 to 10 minutes.

If you already use system cron then it makes sense to decrease the default delay. You can set the same interval as wp-cron.php called by system cron. This will increase audit speed.

Important note: The content audit process uses your website resources and can slow the site for your visitors on weak hostings. Low delay may be a reason the site to become unresponsive. In this case the delay should be increased – this will decrease resource usage and audit speed.

Sometimes even with system cron an audit may take longer than the time selected in the setting. The delay may be caused by:

  • site resources (CPU load, available memory, database load);

  • external API (Ahrefs, GA, GSC) responses.

Did this answer your question?