Removing Submenu from Menu

You can change nav menu args via the wp_nav_menu_args filter.

So let’s say you have a theme that does something like this…

<?php
wp_nav_menu(array(
    'theme_location'   => 'second_level',
    'depth'            => 2, // how many levels to show
    // prolly some other stuff here
));

You can hook into wp_nav_menu_args, check for the theme location, and set depth to be 1 and remove submenus.

<?php
add_filter('wp_nav_menu_args', 'wpse87565_change_depth');
function wpse87565_change_depth($args)
{
    if (!empty($args['theme_location']) && 'second_level' === $args['theme_location']) {
        $args['depth'] = 1;
    }

    return $args;
}