Page Slug Rename
Rename ProcessWire page slugs across local and remote environments, with automatic sync-folder reconcile and PagePathHistory 301 redirects.
When a page URL needs to change — SEO slug updates, doc restructuring, or aligning a sync folder with a new path — pw_page_rename renames the ProcessWire page slug on local, remote, or both environments in one call. Dry-run by default.
When to use rename vs reconcile
| Tool | Use when |
|---|---|
pw_page_rename | You want to change the page slug in ProcessWire (and optionally on production). Creates a 301 redirect when PagePathHistory is installed. |
pw_sync_reconcile | The page was already renamed or moved in ProcessWire and your local sync folders are out of date. Fixes path drift without changing the live slug. |
After a successful local rename, PromptWire automatically runs sync reconcile to move site/assets/pw-mcp/.../old-slug/ to the new path. Pass reconcileLocal: false to skip.
Basic workflow
Rename /docs/promptwire/v1/tools-reference/ to mcp-tools-reference on both local and production. Dry-run first.
Or via MCP:
pw_page_rename
idOrPath: "/docs/promptwire/v1/tools-reference/"
newName: "mcp-tools-reference"
targets: "both"
dryRun: true
Review the preview, then set dryRun: false to apply.
Parameters
| Parameter | Description |
|---|---|
idOrPath | Page ID or canonical path (for example /about/team/). |
newName | URL-safe page name/slug only — not the full path. ProcessWire keeps the page under its existing parent. |
targets | local (default), remote, or both. Remote uses the PromptWire HTTPS API — same pattern as pw_page_push. |
dryRun | Preview without applying. Defaults to true. |
reconcileLocal | After a local rename, move the pw-mcp sync folder to match. Defaults to true for local/both targets. |
syncDirectory | Sync root for folder reconcile (default: site/assets/pw-mcp). |
Safety checks
- Name collisions — refuses to rename if the new slug already exists under the same parent.
- System pages — refuses home, admin, and other protected pages.
- PagePathHistory — reports whether the module is installed. When present, ProcessWire records the old path and serves a 301 redirect automatically.
Remote rename
Remote renames call the PromptWire API on production — no SSH or manual admin clicks. This is useful when docs or content slugs need updating on the live site after you've already renamed locally:
Rename the page at /guides/old-slug/ to new-slug on production only.
Set targets: "remote". The local sync tree is untouched unless you also pass targets: "both".
CLI equivalent
php site/modules/PromptWire/promptwire-cli.php page:rename \
--id-or-path="/about/old-slug/" \
--new-name="new-slug" \
--targets=both
Remote push via CLI is not supported — use pw_page_rename with targets: "remote" for production renames.
Related
- Content Sync Workflow — pull/push after a rename
- Reconciliation — fix sync folders when the slug was changed outside PromptWire
- MCP Tools Reference — full parameter list
Last updated