// Reduces the primary navigation menu to one level depth.
add_filter( 'wp_nav_menu_args', 'custom_primary_menu_args' );
function custom_primary_menu_args( $args ) {
// if this is not a menu assigned to Primary Navigation theme location, abort.
if( 'primary' !== $args['theme_location'] ) {
return $args;
}
$args['depth'] = 1;
return $args;
}