Reindex country-zone product prices
Use the site-scoped WP-CLI commands when the administration index needs installation, inspection, validation, or a controlled rebuild. This guide is intended for site administrators with command-line access.
Before you begin
- Back up the site database according to your normal operations policy.
- Confirm WooCommerce and POM Tweaks are active on the target site.
- Use
--urlto select exactly one site. The command never traverses every multisite site automatically. - Run commands from the WordPress installation or provide the appropriate global WP-CLI path option.
Replace https://store.example in the examples with the target site's URL.
Inspect the current site
Run:
wp pomtweaks country-zone-pricing status --url=https://store.example
Review the selected blog ID, zone count, schema readiness, saved product count, indexed row count, rebuild status, cursor, and error count.
Validate without writes
Run:
wp pomtweaks country-zone-pricing reindex --dry-run --batch-size=50 --url=https://store.example
The dry run validates each product's country-price document in bounded batches. It does not install the index, change product metadata, or write index rows.
Install or rebuild
To install or upgrade the current site's empty index without scanning products, run:
wp pomtweaks country-zone-pricing install --url=https://store.example
To rebuild all parent products and their variations, run:
wp pomtweaks country-zone-pricing reindex --batch-size=100 --url=https://store.example
For a maintenance window with a fixed amount of work, limit the number of batches:
wp pomtweaks country-zone-pricing reindex --batch-size=50 --max-batches=10 --url=https://store.example
If products remain, the command prints a resume cursor. Continue with the exact selected site and cursor:
wp pomtweaks country-zone-pricing reindex --batch-size=50 --start-after=12345 --url=https://store.example
The expected result is zero validation errors and a final status of complete. A deliberately limited run reports paused until it is resumed.
Verify the result
- Run the
statuscommand again. - Confirm schema_ready is
yesand reindex_errors is0. - Confirm reindex_status is
completeafter the final batch. - Open Products → All Products and check the enabled-zone columns for representative simple, variable, subscription, and variable-subscription products.
- Open Tools → Site Health → Status and confirm Country pricing product index is good.
Troubleshooting
A product fails validation
The command identifies the product. Edit that product, correct the reported regional value, save it, and resume from a cursor before the failed product so it is processed again.
The command targets the wrong subsite
Stop and rerun it with the exact --url for the intended store. Product data and the index are deliberately isolated per site.
A bounded run stops with products remaining
This is expected when --max-batches is used. Copy the printed --start-after cursor into the next command.
Site Health says the index is rebuilding
Wait for the bounded background process to finish, or run the explicit reindex command during a suitable maintenance window.