Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove classes from body_class()
* Remove classes from body_class()
* @param array $wp_classes
* @return array
function ja_remove_body_classes( $wp_classes ) {
// The classes you wish to remove
$blacklist = array( 'reply' );
// Remove classes from array
$wp_classes = array_diff( $wp_classes, $blacklist );
// Return modified body class array
return $wp_classes;
add_filter( 'body_class', 'ja_remove_body_classes', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment