Skip to content

WP-CLI

The plugin adds commands to WP-CLI under wp updates-notifier. Use them to run the check from a system cron, to see what a check would do, to test your channels, to switch channel instances on and off, to mute plugins and themes and to see the state of the plugin.

Run them from the site's directory, or add --path=/path/to/site.

check

Runs the update check now, as the schedule does. Each channel instance gets the updates it has not been told about yet, and each line says what happened.

This runs outside WP-Cron, so WordPress's automatic updates do not run first. An update that WordPress would install later can be reported. A scheduled check, including wp cron event run sc_wpun_update_check, runs them first. See Updates WordPress installs automatically.

wp updates-notifier check [--dry-run] [--force]
Option What it does
--dry-run Shows what would be sent, and prints the message for each channel. Nothing is sent or saved.
--force Sends everything that is waiting again, even what was already sent, and to channels that were set to skip it. A channel that is switched off, or was told by a service to wait, still gets nothing.

Sample output:

Office (office): sent 5 items
Client (client): nothing new
Success: Check finished. 1 channel instance was sent a message.

A dry run says what it would do:

Office (office): would send 5 items
...
Success: Dry run finished, nothing was sent or changed. 1 channel instance would be sent a message.

The line for each channel is one of these:

  • switched off
  • waiting until <date and time>: the service asked the plugin to wait.
  • recorded without sending: the channel was set to skip what was waiting.
  • sent 3 items or would send 3 items
  • sent a reminder with 3 items or would send a reminder with 3 items
  • nothing new
  • failed: <reason>

If no channel is switched on and available, the command warns and does nothing.

Exit codes. The command exits with 0 when it worked, also when there was nothing to send. It exits with 1 when a channel failed, so a system cron can tell you.

Note

The check, and so check --dry-run, asks WordPress to refresh its update data first. That is the same as every check does. WordPress skips the request if it asked recently.

test

Sends a test message. It has no updates in it.

wp updates-notifier test [--channel=<id>]

With --channel, the command tests that one channel instance. Find the id with wp updates-notifier channels list. Without it, every channel that is switched on, available and able to send a test message is tested.

Success: Test message sent through Office.

Exit codes. 0 when every test message was sent. 1 when the id is unknown, the channel is switched off, its module is not available (the message says why), it can not send test messages, or the send failed. Without --channel, 1 also when no channel could be tested.

status

Shows the settings, the schedule, the channels, the mutes and the updates that are waiting.

wp updates-notifier status [--format=<table|json>]

It shows:

  • Settings. The value of each setting and where it comes from: database, or for example a constant.
  • Schedule. The frequency, when the next check is due and when the last one ran, in the site's time zone.
  • Channels. For each channel instance: the module, whether the module is available, whether it is switched on, whether it is defined in code, the last delivery result, the last failure and the time it must wait until. Then its settings, each with its source.
  • Muted. The plugins and themes that are muted, as muted lists them.
  • Pending updates. For each channel instance, what is waiting for it, and which of that is new to it and which it was told about already. An auto_update column says yes when WordPress is set to install the update by itself.

Sample output:

Settings
setting         value  source
frequency       daily  database
notify_core     all    database
...
Schedule
frequency  next_run                       last_check
daily      2026-01-02 08:00:00 UTC        2026-01-01 08:00:01 UTC
Channels
id      label   module  availability  enabled  code_defined  last_result
office  Office  email   available     yes      no            success, 2026-01-01 08:00:01 UTC:

Secrets are never shown. A secret setting, such as an API token or a webhook address, shows only set or not set, in the table and in the JSON. If the module of a channel instance is not available, its settings are not shown at all, because without the module the plugin can not tell which ones are secret.

Exit code. 0.

In the JSON the sections are settings, schedule, channels, muted and pending. muted is a list with one entry for each mute, with the keys type, key, name (null if the item is not installed), until (null for an always-on mute), from_code, time, user (a user id, 0 if none), offered (the version waiting, or null), expires (when a snooze ends, as a Unix time, or null) and source (where the mute was set from, an empty string if not known).

Note

To find what is waiting, status does a dry run of the check. It sends and saves nothing, but it asks WordPress to refresh its update data, as check --dry-run does.

mute

Mutes plugins or themes, so the notifications leave them out. See Muting a plugin or theme for what that does.

wp updates-notifier mute <plugin|theme> <name>... [--until-next-version] [--for=<duration>] [--until-date=<date>]

A plugin is named as for wp plugin: its directory name, its file for a single-file plugin, or its full file path from the plugins directory. A theme is named by its stylesheet. Names must be installed.

Option What it does
--until-next-version Skips only the version that is waiting now, so a newer version is notified again. It fails for an item with no update waiting.
--for=<duration> Snoozes for this long: a whole number and h (hours), d (days) or w (weeks), for example 12h, 3d or 2w. Not with --until-date.
--until-date=<date> Snoozes until this date, as YYYY-MM-DD (the start of that day) or YYYY-MM-DD HH:MM, in the time zone of the site. It must be in the future. Not with --for.
wp updates-notifier mute plugin akismet hello.php
wp updates-notifier mute theme twentytwentyfive --until-next-version
wp updates-notifier mute plugin akismet --for=1w
wp updates-notifier mute plugin akismet --until-date="2026-12-01 09:00"
wp updates-notifier mute plugin akismet --until-next-version --for=2w

A snooze ends by itself, and the update is sent again at the next check. With --until-next-version the mute ends at the first of the two. Using --for and --until-date together, a wrong value or a date in the past is an error, and nothing is changed.

Muting an item that is already muted the same way is a warning, not an error. Every name is handled even if one fails. A mute that is set in code, or that a site's code refuses, is an error with the reason.

Exit codes. 0 when every name was handled. 1 when a name is not installed, there is no update to skip, or a mute was refused. The last line then says how many names failed.

unmute

Turns notifications on again.

wp updates-notifier unmute <plugin|theme> <name>...

Unmuting an item that is not muted is a warning. A mute that is set in code, or that a site's code refuses to remove, is an error. Names and exit codes are as for mute.

muted

Lists the muted plugins and themes, including the ones set in code.

wp updates-notifier muted [--format=<table|json|csv|yaml|count>]

The columns are type, name, key, mute (always or version X), expires (when a snooze ends, in the time zone of the site, empty if the mute has no end time), set_in_code, muted_by (a user name, empty if not known), source (where the mute was set from: plugins_screen, settings, cli, api or an add-on's name, empty if not known), muted_at and update (the version waiting, if any). --format=count prints only the number.

type    name         key                  mute          expires                  set_in_code  muted_by  source  muted_at                 update
plugin  Akismet      akismet/akismet.php  always        2026-01-08 08:00:01 UTC  no           admin     cli     2026-01-01 08:00:01 UTC
plugin  Hello Dolly  hello.php            version 1.7.3                          no           admin     cli     2026-01-01 08:05:12 UTC  1.7.3

Exit code. 0.

channels list

Lists the channel instances.

wp updates-notifier channels list [--format=<table|json|csv|yaml|count>] [--fields=<fields>]

The fields are id, label, module, availability, enabled, code_defined (yes when the instance is defined in code, so it can not be changed on the settings screen), last_result, last_failure, retry_at and held_until. The list shows id, label, module, availability, enabled, code_defined, last_result and held_until unless you pass --fields. --format=count prints only the number of instances. wp updates-notifier status shows where each setting of an instance comes from.

id      label   module  availability  enabled  code_defined  last_result
office  Office  email   available     yes      no            success, 2026-01-01 08:00:01 UTC:

availability is available, rejected: <reason> when the module needs a newer version of the plugin, or unknown module when the module is not installed or not active.

channels enable and channels disable

Switches channel instances on or off, as the switch on the Channels tab does.

wp updates-notifier channels enable <id>...
wp updates-notifier channels disable <id>...

Find the ids with wp updates-notifier channels list. Each id gets a line. An instance that is already in the requested state is saved again and reported as a success.

Success: Office disabled.
Error: slack_ops: Slack Ops is defined in code and cannot be changed here.
Error: 1 of 2 could not be changed.

An id is refused, with the reason, when it is unknown, when the instance is defined in code, or when its enabled setting comes from a constant or environment variable. The other ids are still changed.

Exit codes. 0 when every instance was changed. 1 when no id is given, or when any id was refused.

Run the check from a system cron

Stop WordPress starting WP-Cron on page loads, in wp-config.php:

define( 'DISABLE_WP_CRON', true );

Then run the check from the server's crontab, for example every hour:

0 * * * * wp updates-notifier check --path=/var/www/example.com --quiet

Run wp updates-notifier check --dry-run and wp updates-notifier test once by hand first. See also How do I run the check from a system cron or WP-CLI?.