Coinflip Slug Manager
A WordPress plugin to manage front-end URL slugs for Custom Post Types and Taxonomies — no code changes needed.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/adnan051/slug-manager/archive/refs/heads/main.zipA lightweight WordPress plugin that lets you change the front-end URL slugs of any Custom Post Type (CPT) or Taxonomy — straight from the WordPress admin, without touching a single line of code.
✨ Features
| Feature | Details |
|---|---|
| CPT Slug Control | Change the URL base of any public, non-builtin post type |
| Per-CPT Taxonomy Slugs | Set a different slug for a taxonomy based on which CPT it's attached to |
| 301 Redirect Tracking | Old slugs are automatically 301-redirected to new ones — no broken links |
| Live Preview URLs | See exactly how the URL will look before you save |
| Auto Flush | Rewrite rules are flushed automatically after saving |
| Manual Flush Button | One-click fallback if URLs still 404 after saving |
| WooCommerce-aware | Skips WC post types and taxonomies entirely |
| ACF-aware | Ignores ACF internal post types |
| Sorted UI | CPTs and taxonomies are displayed alphabetically |
📋 Requirements
- WordPress 6.0+
- PHP 8.0+
- Tested with WooCommerce and ACF (Advanced Custom Fields)
🚀 Installation
Option A — Upload via WordPress Admin
- Download this repository as a
.zipfile (Code → Download ZIP). - Go to Plugins → Add New → Upload Plugin.
- Upload the
.zipand click Install Now → Activate.
Option B — Manual Upload via FTP/SSH
- Clone or download this repository.
- Upload the
coinflip-slug-managerfolder to/wp-content/plugins/. - Activate the plugin from Plugins → Installed Plugins.
Option C — WP-CLI
wp plugin install https://github.com/your-username/coinflip-slug-manager/archive/refs/heads/main.zip --activate
🛠 Usage
- Go to Settings → Slug Manager in the WordPress admin.
- Find the CPT or Taxonomy you want to change.
- Type the new slug in the New Slug column.
- Check the live Preview URL to confirm it looks right.
- Click 💾 Save All Changes.
Rewrite rules are flushed automatically. If you see 404 errors, click 🔄 Flush Rewrite Rules Manually at the bottom of the page.
🗂 How It Works
WordPress Register → Plugin intercepts args → Applies saved slug → Rewrites updated
↓
Old slug stored → 301 redirect fires on template_redirect
- CPT slugs are applied via the
register_post_type_argsfilter (priority 999). - Taxonomy slugs are applied via
register_taxonomy_args(priority 999) andterm_link. - Old slug redirects are stored in
wp_optionsand processed ontemplate_redirect(priority 1, before theme). - Rewrite flush runs on
initat priority 99999 to ensure all post types/taxonomies are already registered.
⚙️ Options Stored
| Option Key | Contents |
|---|---|
coinflip_custom_slugs |
Array of CPT slugs and per-CPT taxonomy slugs |
coinflip_old_slugs_redirects |
Map of old-slug → /new-slug/ for 301s |
coinflip_slugs_need_flush |
Flag: 1 triggers a rewrite flush on next init |
❓ FAQ
Q: Will old URLs break?
A: No. Old slugs are automatically 301-redirected to the new ones.
Q: Does this work with WooCommerce?
A: Yes — WooCommerce post types (product, shop_order, etc.) and taxonomies (product_cat, product_tag, etc.) are intentionally excluded so this plugin never interferes with WooCommerce's own URL handling.
Q: Can I reset a slug back to the original?
A: Clear the field (leave it blank) and save. The plugin will fall back to WordPress's registered default.
Q: I'm seeing 404s after saving. What do I do?
A: Click 🔄 Flush Rewrite Rules Manually at the bottom of the Slug Manager page. If that doesn't help, go to Settings → Permalinks and just click Save (a built-in WordPress flush).
Q: Does it work with hierarchical taxonomies (sub-categories)?
A: Yes. Hierarchical terms are preserved in the URL path (/new-slug/parent-term/child-term/).
📁 File Structure
coinflip-slug-manager/
├── coinflip-slug-manager.php ← Main plugin file (everything lives here)
├── README.md
├── CHANGELOG.md
└── .gitignore
📝 Changelog
See CHANGELOG.md.
🤝 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.
- Fork the repo
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
📄 License
GPL-2.0-or-later — same as WordPress itself.