admin - Disable the "Skip to Toolbar" tabbing accessibility feature

admin2025-05-31  0

Is there a WordPress setting or hook that I can use to disable the WordPress "Skip to Toolbar" accessibility feature?

I'm referring to the small popup that appears when tabbing through form controls:

I'd like for the default tabbing functionality to be restored (to tab through my fields without this skip to toolbar step in-between), preferably without having to change the tabindex for any/all of the form elements on my page.

Is there a WordPress setting or hook that I can use to disable the WordPress "Skip to Toolbar" accessibility feature?

I'm referring to the small popup that appears when tabbing through form controls:

I'd like for the default tabbing functionality to be restored (to tab through my fields without this skip to toolbar step in-between), preferably without having to change the tabindex for any/all of the form elements on my page.

Share Improve this question asked Nov 29, 2017 at 10:54 GeorgeGeorge 11310 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It's not possible without JavaScript. The HTML for it is output in the WP_Admin_Bar in a private and protected method with no filter.

You can remove them after the page has loaded with JS like so:

function wpse_287259_remove_skip_link() {
    echo "<script>jQuery( '.screen-reader-shortcut' ).remove();</script>";
}
add_action( 'wp_after_admin_bar_render', 'wpse_287259_remove_skip_link' );

I hope it goes without saying that this is something you should do just for yourself and not do for unsuspecting users who might need or want the accessibility benefits.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748638054a313700.html

最新回复(0)