plugin-icon

Swift Menu Duplicator

作者:Al Amin Ahamed·
Duplicate WordPress menus in one click. Snapshot revisions, export/import JSON, bulk-manage all menus, copy across Multisite, automate with WP-CLI.
版本
1.1.0
最后更新
Aug 3, 2026
Swift Menu Duplicator

Swift Menu Duplicator gives you full control over your WordPress navigation menus. Clone any menu in one click, manage all menus from a dedicated admin page, version them with snapshots, move them across Multisite sub-sites, and automate everything from the command line or REST API.

One-Click Duplication

  • Duplicate button right in the menu editor footer — no page reload required
  • Full hierarchy preserved via a two-pass clone that remaps all parent-child item IDs
  • All item metadata copied — type, object, URL, target, CSS classes, XFN, description
  • Duplicate individual menu items directly from the menu editor
  • Custom name support — filter swift_menu_duplicator_new_menu_name to override the default “(Copy)” suffix

Snapshot Revisions

  • Auto-snapshot — a snapshot is saved automatically before every menu save
  • Manual snapshots — save named snapshots from the menu editor at any time
  • Browse & restore — view all snapshots in an expandable panel and restore with one click; the pre-restore state is snapshotted first
  • Housekeeping — delete individual snapshots you no longer need

Menu Manager (Appearance Menu Manager)

  • Dedicated page listing every menu on the site in a sortable WP_List_Table
  • Bulk duplicate — clone multiple menus at once
  • Bulk export — download selected menus as a single ZIP archive
  • Bulk delete — remove multiple menus in one action
  • Row actions — duplicate or export individual menus directly from the list

JSON Export / Import

  • Export any menu to a portable JSON file (via admin or REST API)
  • Import from a JSON file upload or paste JSON directly into the text area
  • URL find & replace — swap domain names during import for staging production migrations
  • Dry-run preview — review what will be imported before making any changes to the database

Deletion Safety

  • Deleting a menu — from the Menu Manager, the row action, or the Delete Menu button in the editor — captures it first
  • An Undo link appears while the deletion is still recoverable (one hour by default, filterable)
  • Restoring recreates the menu and its items and puts it back in the theme locations it occupied

Block Themes

  • Duplicate, export, and import the Navigation menus block themes actually render (wp_navigation posts), not just classic menus
  • A dedicated Navigation (Block) tab in the Menu Manager, with per-row Duplicate and Export JSON plus bulk duplicate and trash
  • Link counts per menu, and one-click access to the Site Editor
  • Available from WP-CLI and the REST API alongside the classic-menu commands

Multisite Support

  • Copy any menu to another site in your WordPress Multisite network
  • Optional URL find & replace applied to item URLs on the destination site

REST API

Full REST API at /wp-json/swift-menu-duplicator/v1/ for headless and block-editor integrations:

  • POST /menus/{id}/duplicate — duplicate a menu (optional name parameter)
  • GET /menus/{id}/export — export a menu as a JSON payload
  • POST /menus/{id}/items/{item_id}/duplicate — duplicate a single menu item
  • POST /menus/import — import a menu from an export payload
  • GET /menus/{id}/snapshots — list snapshots
  • POST /menus/{id}/snapshots — save a snapshot
  • POST /menus/{id}/snapshots/{snapshot_id} — restore a snapshot
  • DELETE /menus/{id}/snapshots/{snapshot_id} — delete a snapshot
  • GET /navigations — list block navigation menus
  • POST /navigations/{id}/duplicate — duplicate a block navigation menu
  • GET /navigations/{id}/export — export a block navigation menu
  • POST /navigations/import — import a block navigation menu

Permission is controlled by the swift_menu_duplicator_rest_permission filter (defaults to edit_theme_options).

WP-CLI

Full command-line support under the wp swift-menu-duplicator command group:

  • wp swift-menu-duplicator duplicate <menu-id> [--name=<name>] — duplicate a menu
  • wp swift-menu-duplicator export <menu-id> [--output=<file>] — export to JSON
  • wp swift-menu-duplicator import <file> [--name=<name>] [--find=<str>] [--replace=<str>] [--dry-run] [--porcelain] — import from JSON
  • wp swift-menu-duplicator copy-to-site <menu-id> --target-blog=<id> [--name=<name>] [--find=<str>] [--replace=<str>] — copy to a sub-site
  • wp swift-menu-duplicator snapshot list|save|restore|delete <menu-id> [--label=<label>] [--id=<uuid>] — manage snapshots
  • wp swift-menu-duplicator navigation list|duplicate|export|import [<id-or-file>] [--title=<title>] [--output=<file>] — block navigation menus

Multilingual Compatibility

  • WPML — translation meta keys (_icl_lang_duplicate_of, wpml_language, etc.) are stripped from duplicated items automatically
  • Polylang — language meta keys (_pll_synced_taxonomies, _pll_menu_language, etc.) are stripped from duplicated items automatically
  • Additional keys can be excluded via the swift_menu_duplicator_compat_excluded_meta_keys filter

Developer Hooks

  • swift_menu_duplicator_new_menu_name — customise the default duplicate name
  • swift_menu_duplicator_rest_permission — control REST API access
  • swift_menu_duplicator_before_duplicate_item / swift_menu_duplicator_after_duplicate_menu_item — fired around item duplication
  • swift_menu_duplicator_after_import_menu — fired after a successful import
  • swift_menu_duplicator_before_restore_snapshot / swift_menu_duplicator_after_restore_snapshot — fired around a snapshot restore
  • swift_menu_duplicator_after_undo_delete — fired after a deleted menu is restored
  • swift_menu_duplicator_undo_ttl / swift_menu_duplicator_undo_limit — how long deletions stay recoverable, and how many are kept
  • swift_menu_duplicator_item_meta_keys — control which meta keys are copied
  • swift_menu_duplicator_compat_excluded_meta_keys — extend the multilingual meta exclusion list
  • wp_update_nav_menu — triggers auto-snapshot before every menu save

Security

  • All AJAX actions verified with nonces and edit_theme_options capability checks
  • All output escaped; all input sanitized
  • Database queries use $wpdb->prepare() — no string concatenation
  • REST API permission is filterable but defaults to edit_theme_options
  • WordPress Filesystem API used for all file read/write/delete operations

Requirements

  • WordPress 6.0 or higher
  • PHP 7.4 or higher
  • User with edit_theme_options capability
免费基于付费套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 7.0.3
这个插件是可用的下载,适用于您的站点。