Support » Requests and Feedback » Menu shouldn't show draft pages

Menu shouldn't show draft pages

  • Being able to schedule a page or post to be published is great. But, I can’t find any way to also have the new page added to a particular menu as soon as it goes live. So now I have this great automated way to set up a future page, but I still have to remember to log in and add the menu. Do you know of any plugin or setting that will help with this issue?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator

    Have you noticed the “Automatically add new top-level pages” checkbox at the top of your custom menu in Appearance -> Menus?

    I think what he asks is that if a menu item links to a page that has the status ‘draft’, the menu item itself should be hidden for the public also.

    Is that possible?

    Also, that checkbox you mention, works only for top-level menu items. It is actually a kinda dangerous checkbox if you tend to forget to set the parent page for a new page. Especially because it doesn’t remove the menu item after you have “fixed” the forgotten parent page setting.

    I’d like to do this as well, but plugins like Revisionary aren’t working with my theme :/

    I used this as a solution for hiding draft pages. You can hide the (draft page) menu items with the li.draft class.

    add_filter('nav_menu_css_class' , 'nav_menu_add_post_status_class' , 10 , 2);
    function nav_menu_add_post_status_class($classes, $item){
    	$post_status = get_post_status($item->object_id);
    	$classes[] = $post_status;
    	return $classes;
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Menu shouldn't show draft pages’ is closed to new replies.