admin管理员组文章数量:1335130
I've done some searches but maybe I'm searching on the wrong terms. Does anyone know if there's a way to bulk-delete menu items in the new Appearance > Menus system? This is mostly to clean up localhost installations, so I'm totally open to plugins if anyone knows of one. I'd be thrilled if I could delete a Page and have all its sub pages (the ones I set as its sub pages via the Menu, not necessarily its real Child pages) also disappear from the menu, for instance.
Thanks for any help!
I've done some searches but maybe I'm searching on the wrong terms. Does anyone know if there's a way to bulk-delete menu items in the new Appearance > Menus system? This is mostly to clean up localhost installations, so I'm totally open to plugins if anyone knows of one. I'd be thrilled if I could delete a Page and have all its sub pages (the ones I set as its sub pages via the Menu, not necessarily its real Child pages) also disappear from the menu, for instance.
Thanks for any help!
Share Improve this question asked Aug 30, 2011 at 17:58 MichelleMichelle 3,4734 gold badges26 silver badges34 bronze badges6 Answers
Reset to default 4I had to do this too, but didn't find a quick and easy way. Since jQuery is available in the wp admin, I used that to select all the delete links and trigger the click event on them:
jQuery('#menu-to-edit')
.find('.submitdelete')
.trigger('click');
There isn't a way to do a bulk delete. Instead, you should just create a new menu with your updated items.
The menu system is meant to be an easy-to-use, configure-once, drag-and-drop interface. There's no bulk delete because, really, very few people would ever need it and such a feature would likely clutter the interface.
Though I've looked, I have never figured out a way to bulk-delete child pages that were set by hand in the new Menu system. But, I have figured out how to auto-add child page via one of these two plugins:
- Gecka Submenu
- Add Descendants As Submenu Items
If the child pages are auto-added via one of these plugins, I believe they call all be deleted simply by removing the parent page item or disabling the auto-add pages.
Hope this helps someone else who's struggling with managing large numbers of menu items (especially after the import process duplicates all of them!).
being I was searching for the answer to the same question and this is the first link in search results I decided to post my solution here.
There is a plugin called "Quick remove menu item" that will help with deleting menu items faster. It hasn't been updated in 2 years but it still works with the latest version of wordpress.
This jQuery answer worked and Quickly! But it delete all items.
if you need to clarify the items to be deleted, then you need to add some conditions. For example, delete all items with "URL" value "#" (usually these are incorrect items left after deleting pages, categories, etc.)
jQuery('#menu-to-edit li.menu-item:has(input[value="#"])')
.find('.submitdelete')
.trigger('click');
I was looking for the same thing, and the answers here didn't really work for me because I really needed to remove a complete sub menu, children incuded.
First, you will need the ID of the parent page, but if you can use jQuery, you probably won't have any trouble with that :)
Then use this two-liner, replacing 100 with your ID :
jQuery('#menu-item-100').find('.submitdelete').trigger('click');
jQuery('.menu-item-data-parent-id[value=100]').parent().find('.submitdelete').trigger('click');
本文标签: Way to bulk delete menu items in new 3x Appearance gt Menus system
版权声明:本文标题:Way to bulk delete menu items in new 3.x Appearance > Menus system? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742381466a2464178.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论