Copy, paste, clone, delete and collapse menu items, duplicate whole menus, export/import menus as JSON, and use shortcodes in menu items β all from the WordPress menu editor.
π₯ Download from WordPress.org | π Documentation | π Report Issues
Six quick action buttons are added to each menu item:
- β New: Instantly create a new custom link below the selected item
- π Clone: Duplicate the item immediately below itself
- π Copy: Copy item data to clipboard with visual highlight (blue background)
- π Paste: Paste the copied item below any target item
- ποΈ Delete: Remove the item without opening its accordion β with confirmation dialog
- β²βΌ Collapse: Fold/unfold all child items under a parent (state saved in
localStorage)
Controls added to the menu editor header:
- ποΈ Duplicate Menu: Clone an entire menu (hierarchy preserved) with one click next to "Save Menu"; auto-named
{name}_copied - β¬οΈ Export Menu: Download the selected menu as a JSON file (top-right "Export Menu")
- β¬οΈ Import Menu: Rebuild a menu from a JSON file as a new menu (top-right "Import Menu"); pages and categories are re-resolved by slug on the target site β ideal for migrating template menus across sites
- 𧬠Shortcodes in menu item URL, navigation label, and description are executed on the front end β no extra metabox needed; theme-defined shortcodes are supported





{original}_copied automatically



- Go to WordPress Admin β Plugins β Add New
- Search for "MenuItem Copy & Paste"
- Click "Install Now" and then "Activate"
- Go to Appearance β Menus to start using the new buttons
- Download the latest release from the releases page
- Upload the plugin files to
/wp-content/plugins/menuitem-copy-paste/ - Activate the plugin through the Plugins menu in WordPress
- Go to Appearance β Menus to start using the new buttons
cd /path/to/wordpress/wp-content/plugins/
git clone https://github.com/sarap422/wp-plugin-menuitem-copy-paste.git menuitem-copy-pasteThen activate the plugin through the WordPress admin panel.
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- Tested up to: WordPress 6.8
WordPress 5.0 or higher. Tested up to the latest version (6.8).
A confirmation dialog appears before deletion. Once deleted, items cannot be restored. However, if you haven't clicked "Save Menu" yet, you can reload the page to revert all unsaved changes.
Yes. Copy an item, switch to another menu, then click Paste on any item there.
Title: New Custom Link, URL: /. Edit them by opening the item's accordion after creation.
The Copy and Clone buttons act on a single item only, excluding its children. To duplicate an entire menu with its hierarchy intact, use the Duplicate Menu button next to "Save Menu".
Parent items that have children show a β²/βΌ toggle at the right end of the button group. Click it to fold or unfold all descendants. The collapsed state is saved per-menu in localStorage and restored on page reload. Items without children do not show the toggle.
No. Dragging a collapsed parent auto-expands it first so its children move together. After the drag, the toggle visibility is re-evaluated based on the updated hierarchy.
Export: Click "Export Menu" (top-right of the menu editor) to download a JSON file of the current menu.
Import: Click "Import Menu", select a previously exported JSON file, and a new menu will be created. Pages and categories are re-resolved by slug on the target site, so the menu migrates correctly even across different WordPress installations.
Any shortcode in a menu item's URL, navigation label, or description is executed on the front end when the menu is rendered. No extra configuration is needed; just type the shortcode directly into the field.
- π‘οΈ Resilience: the plugin now verifies its required
includes/files exist before loading. If any are missing, it shows an admin notice and stops safely instead of causing a site-wide fatal error.
- π οΈ Packaging fix: the
includes/directory andjs/menuitem-menu-tools.jswere missing from the published WordPress.org package, causing a fatal error on activation. Re-published with the complete file set. No code changes.
- 𧬠Added Shortcode support in menu item URL, navigation label, and description
- ποΈ Added Duplicate Menu: clone an entire menu (hierarchy preserved); auto-named
{name}_copied - β¬οΈ Added Export Menu: download the current menu as a JSON file
- β¬οΈ Added Import Menu: rebuild a menu from JSON; pages/categories re-resolved by slug for cross-site migration
- ποΈ Refactored into
includes/(bootstrap + item-actions / shortcode / tools / builder classes)
- β²βΌ Added Collapse: fold/unfold child items under any parent
- πΎ Collapse state persisted per-menu in
localStorageand restored on page reload - π§² Auto-expand parent before drag so children move together
- π― Toggle button auto-shows/hides based on whether the item has children
- π Adjusted button container width to accommodate the sixth button
- β Added New: instantly create a custom link below the selected item
- π Added Clone: duplicate the item immediately below
- ποΈ Added Delete: remove items without opening the accordion
- π¨ Added visual highlight (blue background) for copied items
- π Enhanced security: strengthened
$_POSTvariable validation - β Improved code quality: compliance with WordPress Coding Standards
- Added accurate position calculation respecting hierarchical structure
- Implemented recursive descendant retrieval
- Initial release β menu item copy & paste functionality
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GPL v2 or later β see the LICENSE file for details.
- WordPress.org Plugin Page: https://wordpress.org/plugins/menuitem-copy-paste/
- Support Forum: https://wordpress.org/support/plugin/menuitem-copy-paste/
- GitHub Repository: https://github.com/sarap422/wp-plugin-menuitem-copy-paste
- Author: sarap422
If you find this plugin helpful, please:
- β Star this repository
- π Report issues
- π Write a review on WordPress.org
- π¬ Share with others who might find it useful
Made with β€οΈ by sarap422