Support » Fixing WordPress » wp-cli create sub-menu (e.g. Dropdown)

  • durrmann



    i wonder how to use wp cli to create a Dropdown Menu. I can add PAges to a header using the following command:
    wp menu item add-post Header <PageID>

    However, how do i add a Dropdown menu? In the UI of WordPress, this can be achieved pretty easy by dragging and dropping. How to do this with cli?

    Thanks for your support!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @durrmann!

    You can nest menu items via WP CLI using the --parent-id argument. For example, to nest an existing menu item with db_id=11 underneath a menu item with db_id=10, run:

    wp menu item update 11 --parent-id=10



    @noisysocks Thank you very much for your help!
    Thats exactly what i needed!

    P.S.: I like your shirt!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.