A WordPress plugin that expands your menu capabilities. Bulk select, delete, move, and edit navigation menu items easily.
NavSweeper provides powerful bulk operations for WordPress navigation menus, making it easy to manage large menus efficiently. Instead of editing menu items one by one, you can select multiple items and perform bulk actions.
- Bulk Delete: Select and delete multiple menu items at once
- Bulk Move: Move multiple menu items to different menus or reset their hierarchy
- Bulk Edit: Update label, URL, CSS classes, link target, and description for multiple items simultaneously
- Add Menu Items: Quickly add new custom menu items with full control over positioning
- Easy Selection: Intuitive checkbox interface for selecting menu items
- Menu Support: Ensures menu support is enabled even for block themes
- Download the plugin zip file or clone this repository
- Upload the
navsweeperfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to Appearance → NavSweeper to start managing your menus
This project uses Bun as the package manager and @wordpress/env for local WordPress development.
- Bun installed on your system
- Docker and Docker Compose (required for wp-env)
-
Clone the repository
git clone https://github.com/mgiannopoulos24/navsweeper.git cd navsweeper -
Install dependencies
bun install
-
Start the local WordPress environment
bun run start
This will start a WordPress instance at
http://localhost:8888 -
Setup test menus (optional)
bun run setup
This creates sample menus for testing purposes.
-
Start with setup (one command)
bun run start:setup
This combines starting the environment and setting up test menus.
bun run start- Start the local WordPress environment using wp-envbun run setup- Run the setup script to create test menusbun run start:setup- Start the environment and setup test menus in one commandbun run stop- Stop the WordPress environmentbun run destroy- Destroy the WordPress environment (removes all data)bun run shell- Open a bash shell in the WordPress CLI container
bun run bundle- Create a distribution zip file (navsweeper.zip) containing the plugin filesbun run lint- Run PHP linting on all PHP files in the project
- Navigate to Appearance → NavSweeper in your WordPress admin
- Select a menu from the dropdown
- Use the checkboxes to select menu items you want to modify
- Choose an action:
- Delete: Remove selected items from the menu
- Move: Move selected items to another menu or reset their hierarchy
- Edit: Bulk edit properties like label, URL, CSS classes, etc.
- Add Item: Add a new custom menu item with positioning options
navsweeper/
├── assets/ # CSS and JavaScript files
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript files
├── includes/ # PHP class files
│ └── class-navsweeper.php
├── views/ # Admin view templates
│ └── admin-view.php
├── scripts/ # Setup and utility scripts
│ └── setup-menus.php
├── navsweeper.php # Main plugin file
├── package.json # Dependencies and scripts
└── .wp-env.json # WordPress environment configuration
- WordPress 5.0 or higher
- PHP 8.3 or higher (for development)
- Bun (for development)
The plugin uses WordPress's standard plugin structure and follows WordPress coding standards. The local development environment is configured to use:
- WordPress latest version
- PHP 8.3
- Twenty Twenty-Five theme
- Debug mode enabled
This plugin is licensed under the GPL v3 license.
Contributions are welcome! Please feel free to submit a Pull Request.