Getting rid of role=”navigation” in the Home Page Pagination

navigation is the default value for role attribute in nav elements. So, if the browser/technology understands HTML5 and is fully standard compliant, then it is unnecessary, but what if not? I don’t get the advantage of removing it; it just make sure that any technology reading the document knows what the element is used for.

Anyway, if you want to remove it, you can filter the navigation markup template:

add_filter( 'navigation_markup_template', 'cyb_navigation_template' );
function cyb_navigation_template( $template ) {
    $template="
    <nav class="navigation %1$s">
        <h2 class="screen-reader-text">%2$s</h2>
        <div class="nav-links">%3$s</div>
    </nav>";

    return $template;

}