WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried adding a new programmatically on wordpress with the function:

 wp_update_nav_menu_item($menu, 0, array('menu-item-title' => $title,
            'menu-item-object' => 'page',
            'menu-item-object-id' => $post_id,
            'menu-item-type' => 'post_type',
            'menu-item-status' => 'publish', // is there any 'delete', 'unpublish' ??
            'menu-item-parent-id' => $parent

This works when I create a page but I want to change the parent or just update the page this function adds the page again in the menu.I want to know if there is a way I can delete or update the menu item from dhe menu?

share|improve this question

Try giving menu-item-status as draft instead of publish

share|improve this answer
Please back your answers with good amount of reasons and explanations. – Maruti Mohanty Dec 2 '13 at 11:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.