🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

How to Remove the Admin Toolbar at the Top of a WordPress Website

By default, after installing WordPress, there is an admin panel option at the top called the Admin Bar, which allows quick switching to the admin Dashboard and publishing Posts, etc. However, not everyone likes it. This article teaches you how to remove this admin bar.管理员条The image above is the Admin Bar (administrator toolbar). Sometimes it might look ugly when displayed, so we want to delete or hide it.The method to remove the Admin Bar is as follows:Open the website's WP Admin, go to Appearance, Theme Editor, modify the functions.php file, and insert the following code
// Hide Admin Bar
show_admin_bar( false );
The admin bar will be hidden on the Frontend. If you are unsure how to manually add code to the theme's functions.php file, you can use the following method to achieve it.References:https://developer.wordpress.org/reference/functions/show_admin_bar/Show admin bar only to administrators
// 对非 Administrator 用户均隐藏顶部工具条(Admin Bar)
function my_function_admin_bar($content) {
return ( current_user_can( 'administrator' ) ) ? $content : false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
// 只对有管理权限的用户显示顶部工具条(Admin Bar)
if ( ! current_user_can( 'manage_options' ) ) {
show_admin_bar( false );
}
Another way to hide the toolbar without modifying code:If you find adding code troublesome, you can also set it by modifying the 'Show Toolbar when viewing site' option on your profile page.隐藏管理员工具条

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: