Whitelist Menu Item Classes

 * Clean Nav Menu Classes
function ea_clean_nav_menu_classes( $classes ) {

	if( ! is_array( $classes ) )
		return $classes;

	$allowed_classes = array(

	return array_intersect( $classes, $allowed_classes );
add_filter( 'nav_menu_css_class', 'ea_clean_nav_menu_classes', 5 );

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk