تحميل

How to Hide the WordPress Admin Bar Using a Plugin or Code

Updated at
22/08/2023
Views
5746

There are a few different ways to hide the WordPress admin bar when logged in, using either a plugin or code.

  1. Use a plugin: There are several plugins available that allow you to hide the admin bar, such as "Admin Bar Control", "Disable Admin Bar", and "Simple Admin Bar Removal". Simply install and activate one of these plugins, and the admin bar will be hidden on the front-end of your site.

  2. Use code: You can also hide the admin bar using code by adding the following code snippet to your theme's functions.php file:

add_filter('show_admin_bar', '__return_false');

Additionally, you can also use CSS to hide the admin bar. Add the following code snippet to your theme's style.css file:

 
#wpadminbar { display: none; }

Please note that, before making any changes to the code, it's highly recommended to backup your site and use a child theme, so that your changes will be preserved when updating the main theme.

Also, you can use a plugin like "Custom CSS and JS" to add the CSS code, which will allow you to keep your custom CSS separate from the theme's CSS, and it won't get lost when theme updates.

YottaSrc footer

لماذا تختارنا؟

أفضل الأسعار, تخزين SSD سريع و دعم فني
24/7 حقيقي

control panel icon
cPanel

إدارة موقعك من خلال CPanel بأحدث إصدار

security icon
سريع وموثوق وآمن

ضمان وقت تشغيل بنسبة 99.8٪.
لذا ركز على عملك!

support icon
دعم 24/7/365

ليلاً أو نهارًا ، مطر أو شمس ،
فريقنا هنا من أجلك!

cloud backup icon
نسخ احتياطي يومي

نسخ احتياطي يومي وأسبوعي.
ملفاتك آمنة!