Andrew
Member
Posted 6 months ago #
Hello.
Is there anyway to remove the admin bar completely? It's taking space on my page even though it's not showing.
I guess it shows because of wp_head. is there anyway to prevent wp_head from adding it at all, instead of just hiding it?
Please help.
Thank you,
Andrew
You can remove the admin bar via your profile settings in the backend or you can add the following code to your functions.php.
/*
* Remove the admin bar and admin bar settings
*/
add_action( 'init', 'disable_admin_bar' , 9 );
function disable_admin_bar() {
// Hide Admin Bar
add_filter( 'show_admin_bar', '__return_false' );
add_action( 'admin_print_scripts-profile.php',
'hide_admin_bar_settings' );
}
Andrew
Member
Posted 6 months ago #
Okay, never mind. I seem to have figured it out. I had it set to show on the dashboard.. But it wasn't showing anyway? Just the space for it was apparent.
Anyway, I got it hidden now.
Thank you,
Andrew
Andrew
Member
Posted 6 months ago #
Okay, thank you, w1nk5.
Does this remove the code or hide it? Some people said that the code still takes up memory if you just hide it.
Please help.
Thank you,
Andrew
The code above will stop the admin bar from loading when WordPress is initializing.
Andrew
Member
Posted 6 months ago #
Okay, thank you.
:Dd
-Andrew