I’m seeing a lot of guides on how to add more classes to a WordPress body tag, but is there a way to remove all classes from a specific page template, more specifically the search page?

Here’s where I’m at so far.. not much sorry.

add_filter('body_class', 'remove_search_class');
function remove_search_class($classes){
global $post;
if(is_search()) {
    // find ".search & .search-results"
    }
    return // no classes within <body>
}

Read more here: Remove WordPress body classes on search page


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: