Docs PromptWire Version 1.x Page Slug Rename

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

ToolUse when
pw_page_renameYou want to change the page slug in ProcessWire (and optionally on production). Creates a 301 redirect when PagePathHistory is installed.
pw_sync_reconcileThe 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

ParameterDescription
idOrPathPage ID or canonical path (for example /about/team/).
newNameURL-safe page name/slug only — not the full path. ProcessWire keeps the page under its existing parent.
targetslocal (default), remote, or both. Remote uses the PromptWire HTTPS API — same pattern as pw_page_push.
dryRunPreview without applying. Defaults to true.
reconcileLocalAfter a local rename, move the pw-mcp sync folder to match. Defaults to true for local/both targets.
syncDirectorySync 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

Last updated