• Is it possible to add a menu item to a specific section without dragging it?

    I’m trying to figure out if it’s possible to add a menu item (to a specific position in a menu that might have 50, 100, etc. items) without having to drag it.

    I see I can select “Up one, Under Home, or To the top” (or drag the menu item to where I want to place it) but I’m wanting to be able to place the menu item directly above or below another specific menu item.

    Is there a plugin available to allow for this functionality?

    Is there any way to do this with or without using a plugin that would allow me to specifically send a new (or existing) menu item to a specific location in a menu so I can avoid having to drag and drop it?

    Please let me know.

    – Gary Gordon

    • This topic was modified 1 year, 11 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Not through the WP UI, but it is possible in a hacky sort of way. It’s a little involved, but it might be easier than dragging or up-one-ing over a ton of items.

    You’ll need to access the phpMyAdmin app. Locate the WP DB and its postmeta table. You’ll also need the ID of the menu item near where you’d like the new item to appear. If your browser is set to display link URLs on hover, hover over the existing item’s down arrow. The ID is the integers in the URL query string. (you have to use the original admin nav-menu screen, the browser hover feature doesn’t work in the customizer).

    After you add a new item, go to the last page of the postmeta table in phpMyAdmin. The last postmeta item keyed “_menu_item_menu_item_parent” should be for the last entered menu item. Change the related meta_value field from 0 to the item ID you want the new item to be near. Click “Go”. When you reload the admin nav-menu screen, the new item will appear as a child of the item ID you used. You can then drag the new item to whatever nearby final position you want if a child position isn’t what you wanted.

    This all sounds pretty complicated, but once you’ve gone through the process a couple times you’ll find it’s not really that difficult. Certainly unwarranted for typically sized menus, but for gigantic menus it could make sense.

    It’s recommended that you keep a recent DB backup before making any changes through phpMyAdmin because it’s all too easy to corrupt the DB through this app. But if changes are limited to that one meta key, it’s relatively safe to do. I admit to making changes without a recent backup, but I know the risks involved and like living dangerously 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to add a menu item to a specific section without dragging it?’ is closed to new replies.