Remove role=”search” in get_search_form()

Adding this PHP snippet to the functions.php of your wordpress theme will remove the role=”search” from the get_search_form() HTML output. Please note that role is an attribute introduced in XHTML draft for accessibility however does not validate.




function valid_search_form ($form) {
return str_replace('role="search" ', '', $form);
add_filter('get_search_form', 'valid_search_form');

Be Sociable, Share!

Leave a comment