Skip to content
SapphireIT Labs
Publish Guard documentation

WP-CLI

Registered as wp sit-wcpg only when WP-CLI is running. Output holds product ids, statuses and rule ids, never product text. A WP-CLI request is still excluded from enforcement, so these commands report and never block.

wp sit-wcpg check [<id>...]

Validates products live and writes nothing.

OptionDefaultValues
<id>...the whole catalogproduct ids; anything that is not a product is skipped
--status=<status>anyany (published, scheduled, draft, pending and private), publish, draft, pending, future, private. Ignored when ids are given
--fail-onlyofflist only products that fail a required check
--format=<format>tabletable, json, count, ids
--strictoffexit 1 when any product fails a required check

Columns: id, status (pass, warning, fail or skipped), required_failures (comma-separated rule ids) and warnings (how many non-required checks did not pass). The table format also prints a summary line, counted across everything checked even with --fail-only.

wp sit-wcpg reindex

Rechecks every product in this process and updates the stored flags behind the products list filter and the catalog screen. It needs no Action Scheduler.

Exit codes

CodeWhen
0the command ran; without --strict, failing products are still 0
1the checklist is switched off, or --strict found a failing product

Examples

wp sit-wcpg check --status=publish --fail-only
wp sit-wcpg check --format=json
wp sit-wcpg reindex

Last updated:

Black Friday sale

Black Friday: 80% off every Pro plugin

Your first year, on every plan. The coupon is added for you at checkout.

Ends in The offer ends at 00:00 GMT on 5 December 2026.

Claim deal