Crons Module — User Guide
Table of Contents
The Crons Module gives WordPress administrators a full graphical interface to view, search, filter,
create, edit, run, and delete every WordPress cron job registered on the site — all without writing a single line of
code.
You need the Administrator role (the
manage_options capability) to access the Cronsmodule. Other users will not see its menu items.
Enable / Disable the Module
The Crons module is a standalone module inside Advanced Analytics. You can enable or disable it without affecting any
other part of the plugin or WordPress itself.
- Navigate to Error Logs → Settings in the WordPress admin sidebar.
- Click the “Cron Options” tab (or scroll to the section headed Cron options).
- Toggle the “Enable cron module” checkbox.
- Click Save Changes.
from the admin. It does
not stop WordPress from running its cron jobs. Your existing scheduled tasks will continue to execute
normally.
Module Settings
The Cron Options tab on the Settings page has two settings:
1. Enable cron module
| Type | Checkbox |
|---|---|
| Default | Enabled (checked) |
| Effect | Shows or hides the Crons viewer sub-menu and all associated functionality. Does not affect WordPress core crons. |
2. Global WP Cron disabled
| Type | Checkbox |
|---|---|
| Availability | Only shown if wp-config.php is writable on the server. |
| Effect | Sets or unsets the DISABLE_WP_CRON constant in wp-config.php. When enabled,WordPress will not automatically trigger cron jobs on page loads. |
not writable — you can not
make changes from here.” In that case, edit
wp-config.php manually.(e.g., a server-level
crontab calling wp-cron.php every minute), it is recommended to setDISABLE_WP_CRON to true so that crons don’t double-fire on page load.Cron Jobs List
This is the main screen. It shows every registered cron job on your site in a sortable, filterable table.
Columns
| Column | Sortable | Description |
|---|---|---|
| Hook | Yes | The WordPress action hook the cron executes. Core WP hooks display a small WordPress icon badge. |
| Next Run (UTC+0) | Yes | When the cron will fire next. Shows both the absolute date/time and a human-readable relative time (“10 min”, “2 hrs”). Overdue crons are highlighted. |
| Interval | Yes | Recurrence schedule: hourly, daily, twicedaily, once, orany custom schedule. |
| Args | No | Shows “NO” when no arguments are passed. Otherwise displays the JSON-encoded array (e.g.,[25], ["text"]). |
| Actions | No | Displays the callback function location (file path and line number), the originating component/plugin name. Shows a red background if the callback has errors. |
| Site | No | Multisite only. Shows the blog ID and site name. |
Row Actions
Hover over any cron row to reveal these actions below the hook name:
- Edit — Opens the edit form with all current values pre-filled.
- Run — Executes the cron immediately via AJAX (no page reload). Displays a green “Successfully
run” message. - Delete — Removes the cron after a confirmation dialog. The row fades out on success.
Filters & Views
View Tabs
Above the table you will find quick-filter links. Each shows a count in parentheses:
| Tab | Shows |
|---|---|
| All events (no filters) | Every registered cron — no filtering applied. |
| Events with no action ! | Crons whose callback is missing or deregistered. These are “orphans” that won’t do anything when fired. |
| WordPress core events Core | Built-in WordPress crons such as wp_version_check, wp_update_plugins, etc. |
| Custom events Custom | Crons registered by themes or plugins. |
Dropdown Filters
Use the dropdown menus above the table then click Filter:
Plugin Filter
- Default: “All plugins”
- Lists every detected plugin that has registered at least one cron hook.
- Narrows the table to only crons belonging to the selected plugin.
Schedules Filter
- Default: “All Schedules”
- Options include all registered schedule frequencies (e.g., “Every 1 hour (hourly)”, “Once daily
(daily)”), plus a special “Single event” option for one-off crons.
Site Filter Multisite
- Available only on multisite networks for network administrators.
- Default: “All sites”
- Lists every site in the network with its name.
Searching Crons
Use the search box in the top-right corner of the list page. It searches by hook name only.
- Type part of a hook name and press Enter or click Search.
- The search is case-insensitive and matches anywhere in the hook name.
- To clear the search, empty the box and press Enter.
so you don’t lose your
context while editing a cron.
Single Cron Actions
Run a Cron Immediately
- Find the cron in the list.
- Hover over its row and click Run.
- The cron executes instantly via AJAX — no page reload. A green success message appears briefly.
next automatic run time remains
unchanged (for recurring crons).
Delete a Single Cron
- Find the cron in the list.
- Hover over its row and click Delete.
- Confirm the deletion in the browser dialog: “You sure you want to delete this cron?”
- On success the row fades out and is removed from the table.
that registered it from
re-creating it on the next page load. If you need to permanently prevent a cron, you must deactivate (or modify) the
code that schedules it.
Editing a Cron
Click Edit on any row to open the edit form.
Form Fields
| Field | Type | Description |
|---|---|---|
| Hook | Text input | The WordPress action hook name. You can change it, but make sure a matching add_action()exists. |
| Next Run | Date + Time pickers | When the cron should fire next. Format: yyyy-mm-dd and hh:mm:ss. Uses your site’slocal timezone. |
| Arguments | Textarea (JSON) | Arguments passed to the hook callback. Must be a JSON-encoded array (see the Arguments section below). |
| Schedule | Dropdown | Recurrence: “Non-repeating” (one-shot), “Every 1 hour (hourly)”, “Twice daily (twicedaily)”, “Once daily (daily)”, or any registered custom schedule. |
Click Update to save changes.
time has passed), you will see
an info box: “Cron job does not exist or it has been executed.” The form will not be shown.
Working with Arguments
Arguments are data values that get passed to the cron hook’s callback function. They must be entered as a
JSON-encoded array in the Arguments field.
Argument Format Reference
[25]
Passes the integer 25 as the first (and only) argument to the callback.
["hello-world"]
Passes the string "hello-world" to the callback.
["i", "want", 25, "cakes"]
The callback receives four arguments: two strings, an integer, and another string. In PHP:
<?php
\add_action( 'my_baking_cron', 'bake_order' );
function bake_order( $who, $verb, $quantity, $item ) {
// $who = "i", $verb = "want", $quantity = 25, $item = "cakes"
}[true, false, null]
Passes boolean true, boolean false, and null to the callback.
[["admin", "editor", "author"]]
Passes a single argument which is itself an array containing three strings. In PHP:
<?php
\add_action( 'sync_user_roles', 'do_sync' );
function do_sync( $roles ) {
// $roles = array( "admin", "editor", "author" )
foreach ( $roles as $role ) {
// process each role…
}
}[{"post_type": "product", "limit": 50, "force": true}]
Passes a single object (PHP decodes it as an associative array or object depending on context):
<?php
\add_action( 'refresh_product_cache', 'do_refresh' );
function do_refresh( $config ) {
// $config->post_type = "product"
// $config->limit = 50
// $config->force = true
}["WC_Product", 12345]
The argument values themselves don’t specify the callback — that is determined by what’s hooked to the action. But
you might pass a class name and an object ID when your callback needs to instantiate
a class:
<?php
\add_action( 'process_item_cron', 'handle_item' );
function handle_item( $class_name, $item_id ) {
// $class_name = "WC_Product"
// $item_id = 12345
if ( class_exists( $class_name ) ) {
$item = new $class_name( $item_id );
// process…
}
}[]
Leave the array empty when the callback expects no parameters. You can also leave the field completely empty — the
system defaults to [].
Common Mistakes
| Wrong | Right | Why |
|---|---|---|
25 |
[25] |
Must always be wrapped in an array [ ] |
"hello" |
["hello"] |
Even a single argument needs the array wrapper |
{'key':'val'} |
[{"key":"val"}] |
JSON requires double quotes; objects must be inside the array |
[hello] |
["hello"] |
Strings must be quoted |
silently fall back to an empty array
[]. No error message is shown. Always validate your JSON before saving (you can use a tool likejsonlint.com).
Adding a New Cron
- On the Cron Jobs list page, click “Add New Cron” (top-right, next to the page title).
- Fill in the form fields:
- Hook — The WordPress action hook name. If left empty, a name is auto-generated
(unnamed_hook_XXXX). - Next Run — Date and time for the first execution. Defaults to the current date/time.
- Arguments — JSON-encoded array (see Arguments section). Leave empty
for no arguments. - Schedule — Choose recurrence. Default is “Non-repeating” (fires once then
disappears).
- Hook — The WordPress action hook name. If left empty, a name is auto-generated
- Click Submit (or Update) to create the cron.
need a matching
add_action() in your theme or plugin code for the hook to do anything. Without a matching callback, thecron will appear under “Events with no action”.
Example: Create a Daily Cleanup Cron
| Field | Value |
|---|---|
| Hook | my_daily_cleanup |
| Next Run | 2026-03-24 03:00:00 |
| Arguments | ["temp_files", 30] |
| Schedule | Once daily (daily) |
Then in your theme’s functions.php or custom plugin:
<?php
\add_action( 'my_daily_cleanup', 'run_cleanup', 10, 2 );
function run_cleanup( $directory, $max_age_days ) {
// $directory = "temp_files"
// $max_age_days = 30
// … your cleanup logic here
}Bulk Actions
Perform operations on multiple crons at once:
- Check the boxes next to the crons you want to act on. Use the checkbox in the header row to select all visible
crons. - Open the Bulk actions dropdown (top-left or bottom-left of the table).
- Choose an action:
- Delete — Permanently removes all selected crons.
- Run — Executes all selected crons immediately, in sequence.
- Click Apply.
refreshes after completion.
CSV Export
Export the currently filtered/displayed crons to a CSV file:
- Apply any desired filters or search (the export respects your current filter context).
- Click the “CSV Export” button above the table.
- A progress bar appears during the export. You can click Cancel if needed.
- The CSV file downloads automatically once complete.
Available Schedules
At the bottom of the Cron Jobs list page, a reference table shows all registered cron schedules on your WordPress
installation:
| Frequency | ID | Interval (seconds) |
|---|---|---|
| Every 1 hour | hourly |
3,600 |
| Twice daily | twicedaily |
43,200 |
| Once daily | daily |
86,400 |
| Once weekly | weekly |
604,800 |
The above are WordPress defaults. Plugins and themes may register additional schedules (e.g., “Every 5
minutes”, “Monthly”). These will also appear in the reference table and in the Schedule dropdown when
editing or adding a cron.
(shown as
_oneoff), the cron fires once at the scheduled time and then removes itself automatically.Screen Options
Click Screen Options (top-right of the page, just below the admin bar) to customize the display:
Items per page
Control how many crons display per page. Enter a number and click Apply. This only affects your
user account.
Column Visibility
Check or uncheck columns to show or hide them. Useful for reducing clutter when you don’t need certain information
(e.g., hiding the Args column). Settings persist across sessions.
Multisite Networks
On WordPress multisite installations, the Crons module provides additional capabilities:
- Site column — Each cron row shows which site (blog ID + site name) it belongs to.
- Site filter dropdown — Network administrators can filter the list to show crons from a specific
site. Default shows all sites. - The site filter dropdown is only available to users with the
manage_networkcapability (Super Admin).
Troubleshooting
Cron Spawn Error
If you see a red notice at the top of the Cron Jobs page:
“There was a problem spawning a call to the WP-Cron system on your site… The problem was:
[error]”
Causes & Solutions:
- Your server cannot make HTTP requests to itself (loopback). Ask your hosting provider to allow loopback
connections. - A plugin (e.g., Cavalcade, Cron Control) is managing cron execution. This is normal — the blue info message will
tell you which plugin is in charge. - Consider switching to an external cron trigger (server-level
crontab) if the spawn consistently
fails.
“Cron job does not exist or it has been executed”
This message appears on the edit screen when the cron has already fired (for one-time crons) or been deleted by
another process. Simply go back to the list and refresh.
“Unable to delete cron (no longer exists maybe? Try refreshing the page).”
The cron was already removed (it ran, or another admin deleted it). Refresh the page to update the list.
Events with No Action
These are “orphan” crons — scheduled but with no callback attached. They typically appear when:
- A plugin was deactivated but didn’t clean up its scheduled events.
- The callback function was removed or renamed.
Action: These crons are safe to delete since they do nothing when fired.
Arguments Not Saving Correctly
If your arguments seem to reset to [], your JSON is likely invalid. Common issues:
- Using single quotes instead of double quotes:
['bad']→["good"] - Missing the surrounding array brackets:
"just text"→["just text"] - Trailing commas:
[1, 2,]→[1, 2]
Error Messages Reference
| Message | Cause | Solution |
|---|---|---|
| “Invalid timestamp provided.” | Date or time format is wrong | Use yyyy-mm-dd for date and hh:mm:ss for time |
| “Invalid schedule provided.” | Selected schedule is no longer registered | Choose a different schedule from the dropdown |
| “Cron job can not be added.” | WordPress wp_schedule_event() call failed |
Check for conflicting hooks or object cache issues; try again |
| “WP Config is not writable” | Server file permissions | Modify wp-config.php manually via FTP/SSH |
See
Crons Module Developer Documentation for architectural details, class references, REST APIendpoints, and code examples for extending the Crons module programmatically.