Remove unnecessary nav menu css classes.
<?php
/**
* Remove unnecessary nav menu css classes.
*/
add_filter('nav_menu_css_class', function($classes) {
return is_array($classes) ? array_intersect($classes, array('current-menu-item', 'menu-item-has-children')) : '';
}, 100, 1);
?>
functions.php