Contents

WP-CLI - Plugixa Permalink Manager

PRO Every bulk tool is available as a WP-CLI command under wp plugixa-permalinks. Use it in deployment scripts, over SSH, or on a site too large to babysit in a browser tab.

Commands

Command Does
wp plugixa-permalinks regenerate Regenerate addresses
wp plugixa-permalinks find-replace Find and replace
wp plugixa-permalinks check Health check
wp plugixa-permalinks undo Undo a finished run
wp plugixa-permalinks flush-cache Clear the plugin’s cached lookups

regenerate

wp plugixa-permalinks regenerate --type=<type> [--taxonomy] [--mode=<mode>] [--include-manual] [--dry-run]
Option Meaning
--type=<type> The post type, or the taxonomy when --taxonomy is given. Required
--taxonomy Treat --type as a taxonomy
--mode=default Use the URL pattern (the default)
--mode=native Go back to the WordPress permalink
--include-manual Also change addresses typed by hand
--dry-run Preview only
wp plugixa-permalinks regenerate --type=product --dry-run
wp plugixa-permalinks regenerate --type=product_cat --taxonomy

find-replace

wp plugixa-permalinks find-replace <find> <replace> [--type=<type>] [--taxonomy] [--regex] [--case-sensitive] [--dry-run]

Without --type every post type is searched. Add --taxonomy to search every taxonomy instead; content and taxonomies are separate runs.

wp plugixa-permalinks find-replace "journal/guides/" "journal/how-to/" --type=post --dry-run
wp plugixa-permalinks find-replace "^blog/(\d{4})/" "journal/\$1/" --regex

check

wp plugixa-permalinks check [--fix]

Without --fix nothing is changed; the command reports what it found.

undo

wp plugixa-permalinks undo <job-id>

A real run that changed something prints its job number and the exact undo command:

Success: Job 42: 18 changed, 0 skipped, 0 failed of 18. Undo with: wp plugixa-permalinks undo 42

The line is printed after check --fix as well, but a health-check fix cannot be undone.

flush-cache

wp plugixa-permalinks flush-cache

Address lookups are cached when the site has a persistent object cache. Run this after changing the plugin’s tables directly, for example after a database import.

Reading the output

A preview ends with:

Success: Preview only, nothing changed. 5 changed, 0 skipped, 0 failed of 5.

“Changed” in a preview means “would change”. Items that changed or failed are listed above the summary with their address before and after.

In a deployment script

wp plugixa-permalinks regenerate --type=product --dry-run
wp plugixa-permalinks regenerate --type=product
wp plugixa-permalinks check

Runs made from the command line appear in each item’s history with the tool as the reason, exactly like runs made from the Tools screen.

Multisite

Use WP-CLI’s own --url= option to choose the site. Each site has its own addresses.

Quick Links