🚀 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 Bar at the top with options to quickly switch to the Admin Dashboard and publish posts, among other functions. However, not everyone likes it. This article teaches you how to remove this admin bar.管理员条The image above shows the Admin Bar (administrator toolbar). Sometimes it may appear unattractive, so we might want to delete or hide it.The method to remove the Admin Bar is as follows:Open the website Admin Dashboard, go to Appearance, edit the Theme, modify the functions 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 functions file, you can use the following method to achieve it.Reference: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 whether to display the toolbar on the Frontend by modifying your profile page.隐藏管理员工具条

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

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about 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 to Follow