This project is not covered by Drupal’s security advisory policy.

Page Swap gives site editors a safe, structured way to promote a new version of a page to a live URL without touching DNS, cache configuration, or CMS infrastructure. Select an original page and a replacement, review a full execution plan, and apply the swap in a single click — the replacement instantly inherits the original's public URL alias, all menu items pointing to it, and optionally its published status. If the original page is configured as the site homepage, 403, or 404 error page, those system settings are updated as well.

This is particularly useful for content teams that build new landing pages or campaign pages alongside the live site and need a precise, zero-downtime handoff.

Features

  • Path alias swap — The original page's URL alias is moved to the replacement. The original can be assigned a new alias or left without one.
  • Menu link retargeting — All menu items pointing to the original page are updated to point to the replacement, preserving position, parent, and the full hierarchy of child links.
  • System page awareness — If the original page is configured as the site homepage, the 403 access denied page, or the 404 not found page (under Basic site settings), individual checkboxes let the editor update each of those settings during the swap.
  • Side-by-side visual preview — Before confirming, both pages are rendered in iframes so the editor can visually compare them.
  • Execution plan — A detailed summary of every action to be taken (alias movement, menu updates, system page changes, publish state) is shown before the swap is applied. Nothing happens until the editor clicks Apply Page Swap.
  • Publish state sync — Optionally, publish the replacement page during the swap execution (if not already published).
  • Redirect & Pathauto integration — When the Redirect module is present, automatic redirect creation is temporarily suppressed during the swap to prevent unwanted redirect chains. When Pathauto is present, it is prevented from overwriting the freshly swapped alias on the replacement node.
  • Developer event — Dispatches a page_swap.executed event after every successful swap, giving other modules a clean integration point.
  • Swap History submodule — The optional page_swap_history submodule maintains a timestamped, per-user log of every swap operation in a dedicated administration tab.

Post-Installation

  1. Enable page_swap. Optionally enable the page_swap_history submodule if you want an audit log of past swaps.
  2. Go to People → Permissions and grant the Use Page Swap permission to the appropriate administrator roles. The permission is marked "restrict access" because the operation has irreversible effects on public URLs and site structure.
  3. Navigate to Configuration → Content authoring → Page Swap (/admin/config/content/page-swap).
  4. Type the title of the Original page in the first autocomplete field and the Replacement page in the second.
  5. Click Show Preview to load the side-by-side iframes and the Execution Plan.
  6. Review the plan. Configure the optional fields (new alias for the original, publish state sync, system page checkboxes if applicable).
  7. Click Apply Page Swap.

No additional configuration forms, content types, or text format changes are required.

Additional Requirements

  • Drupal 10 or 11
  • Core path_alias module (enabled by default in Drupal 10+)
  • Core menu_link_content module (enabled by default in Drupal 10+)

AI-Assisted Development

Parts of this module were developed with the assistance of AI coding tools — specifically Google Jules (Gemini 3 Flash) and GitHub Copilot (Claude Sonnet 4.5). All code produced by these tools was thoroughly reviewed by the author, tested, and edited as needed before being included in the module. AI assistance was used to accelerate implementation; architectural decisions, security review, and final code quality remain the responsibility of the human author.

Supporting organizations: 
Partially funded the hours invested in crafting this module and making it happen

Project information

Releases