Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Yöneticiler Dışındaki Tüm Kullanıcılar için WordPress Yönetici Çubuğu Nasıl Devre Dışı Bırakılır

Bazı okuyucularımız bize WordPress yönetici çubuğunu nasıl devre dışı bırakacaklarını sordular. Bu küçük bir değişiklik olsa da, bazı kullanıcılar daha temiz bir kullanıcı arayüzü sağlamak veya yönetici olmayan kullanıcılar için kullanıcı deneyimini geliştirmek gibi çeşitli nedenlerle bunu yapmayı tercih ediyor.

Varsayılan olarak, WordPress yönetici çubuğunu tek tek kullanıcılar için kolayca devre dışı bırakabilirsiniz. Ancak sitenizde çok sayıda kayıtlı kullanıcı varsa bu işlem zaman alıcı olabilir.

Bu makalede, WordPress yönetici çubuğunu yöneticiler hariç tüm kullanıcılar için nasıl kolayca devre dışı bırakacağınızı göstereceğiz.

How to disable WordPress Admin Bar for All Users except administrators

WordPress Yönetici Çubuğu Nedir?

WordPress varsayılan olarak, oturum açmış tüm kullanıcılar için ekranın üst kısmında bir yönetici çubuğu gösterir. Hesabınıza giriş yaptığınızda, bu araç çubuğunu WordPress yönetici alanında ve diğer tüm sayfalarda görebilirsiniz.

The WordPress admin bar

WordPress yönetici araç çubuğu, WordPress’in farklı arka uç alanlarına yönelik kullanışlı kısayollara sahiptir ve bu kısayollar kullanıcının WordPress’teki rolüne ve izinlerine göre değişir.

Ancak, web sitenizin ön ucuna bakarken yönetici çubuğu dikkat dağıtıcı olabilir.

Ayrıca web sitenizin tasarımını ve kullanıcı deneyimini de etkileyebilir. Üçüncü bir taraf için bir WordPress sitesi oluşturuyor veya yönetiyorsanız bu bir sorun olabilir, çünkü web sitelerinin gerçekte neye benzediğini görmelerini engeller.

Neyse ki, yöneticiler hariç tüm kullanıcılar için yönetici çubuğunu devre dışı bırakmanın birden fazla yolu vardır. Kullanmak istediğiniz yönteme atlamak için aşağıdaki hızlı bağlantıları kullanmanız yeterlidir:

Video Eğitimi

Subscribe to WPBeginner

Yazılı talimatları tercih ediyorsanız, okumaya devam edin.

Yöntem 1: WordPress’te Her Kullanıcının İzinlerini Değiştirin

Kullanıcı profillerini düzenleyerek belirli kullanıcılar için yönetici çubuğunu devre dışı bırakabilirsiniz. Yalnızca az sayıda kişi için çubuğu kaldırmanız gerekiyorsa bu hızlı ve kolay bir yöntemdir. Ancak, çok sayıda kullanıcısı olan bir üyelik sitesi işletiyorsanız, farklı bir yöntem seçmenizi öneririz.

Yönetici çubuğunu manuel olarak kaldırmak için WordPress yönetici panosundaki Kullanıcılar ” Tüm Kullanıcılar sayfasına gidin. Ardından farenizi yönetici çubuğuna ihtiyaç duymayan WordPress kullanıcısının üzerine getirin ve göründüğünde ‘Düzenle’ye tıklayın.

How to edit a user's profile in WordPress

Bu, o kullanıcının profilini açacaktır.

Buradan, ‘Siteyi görüntülerken araç çubuğunu göster’ seçeneğinin yanındaki kutunun işaretini kaldırın.

How to hide the admin toolbar for non-admin users

Bundan sonra, ekranın en altına gidin ve değişikliklerinizi kaydetmek için ‘Kullanıcıyı Güncelle’ye tıklayın. Bu, yönetici çubuğunu yalnızca söz konusu kişi için devre dışı bırakacaktır.

Araç çubuğunu daha fazla kullanıcı için gizlemek için yukarıda açıklanan aynı işlemi uygulamanız yeterlidir.

Yöntem 2: Yönetici Olmayan Kullanıcılar için Yönetici Çubuğunu Devre Dışı Bırakmak için Kod Kullanın (Önerilen)

Yönetici çubuğunu çok sayıda farklı kişi için gizlemeniz gerekiyorsa, her kullanıcının ayarlarını manuel olarak değiştirmek çok fazla zaman ve çaba gerektirecektir.

Bu nedenle, bir WordPress tema dosyası olan functions.php dosyasına kod ekleyerek yönetici çubuğunu devre dışı bırakmanızı öneririz.

Bazı kılavuzlar tema dosyalarını manuel olarak düzenlemenizi söyleyecektir, ancak bu yaygın WordPress hatalarına neden olabilir ve hatta web sitenizi tamamen bozabilir.

Bu nedenle WPCode kullanmanızı öneririz. En iyi kod parçacığı eklentisidir ve sitenizi riske atmadan WordPress’e özel kod eklemeyi kolaylaştırır.

Yönetici renk düzenini değiştirmek, ‘Howdy Admin’ metnini kaldırmak, Ekran Seçenekleri düğmesini devre dışı bırakmak ve daha fazlası için WPCode ‘u kullandık.

Öncelikle, ücretsiz WPCode eklentisini yüklemeniz ve etkinleştirmeniz gerekecektir. Daha fazla bilgi için, WordPress eklentisinin nasıl yükleneceğine ilişkin adım adım kılavuzumuza bakın.

Eklenti etkinleştirildikten sonra Code Snippets ” Snippet Ekle bölümüne gidin.

Hiding the admin toolbar using WPCode

Burada, sitenize ekleyebileceğiniz tüm önceden hazırlanmış snippet’leri göreceksiniz.

Aslında, WPCode, yerleşik Snippet Kitaplığında yönetici çubuğunu devre dışı bırakmak için ihtiyacınız olan tam kod parçacığına sahiptir. Basitçe Kod Parçacıkları Kütüphane ye gidin.

The WPCode code snippet plugin for WordPress

Burada, ‘WP Yönetici Çubuğunu Devre Dışı Bırak’ için arama yapın.

Doğru snippet göründüğünde, sadece ‘Snippet Kullan’ düğmesine tıklayın.

The ready-made Disable The WP Admin Bar code snippet

Eklenti kodu sitenize otomatik olarak ekleyecek, koda açıklayıcı bir başlık verecek, doğru ekleme yöntemini seçecek ve hatta snippet’i tanımlamanıza yardımcı olacak etiketler ekleyecektir.

İşte kodun nasıl göründüğü:

/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );

Şimdi, amacınız yönetici çubuğunu tüm kullanıcılar için devre dışı bırakmaksa, yapmanız gereken tek şey anahtarı ‘Etkin Değil’den ‘Etkin’e getirmek ve ardından ‘Güncelle’ye tıklamaktır.

Adding custom code to WordPress

Ancak, amacımız yönetici olmayan kullanıcılar için WordPress yönetici çubuğunu devre dışı bırakmak olduğundan, kodda bazı küçük değişiklikler yapmamız gerekiyor.

Mevcut kodu aşağıdaki ile değiştirebilirsiniz:

/* Disable WordPress Admin Bar for all users except administrators */
add_filter( 'show_admin_bar', 'restrict_admin_bar' );

function restrict_admin_bar( $show ) {
    return current_user_can( 'administrator' ) ? true : false;
}

Bu kod, şu anda yönetici kontrol paneline bakmayan yönetici olmayan kullanıcıları tanımlar. Bu kullanıcılar için WordPress yönetici çubuğunu devre dışı bırakır.

Bundan sonra, sayfayı aşağı kaydırarak ‘Ekleme’ bölümüne gelin. Burada, kodun her yerde çalıştığından emin olmak için varsayılan ‘Otomatik Ekle’ yöntemini koruyabilirsiniz.

Automatically inserting code into a WordPress website

Son olarak, ekranın üst kısmına kaydırın ve ‘Etkin Değil’ kaydırıcısına tıklayarak ‘Etkin’i göstermesini sağlayın.

Ardından, kod parçacığını canlı hale getirmek için ‘Snippet’i Kaydet’ veya ‘Güncelle’ düğmesine tıklamanız yeterlidir.

Publishing a code snippet to disable the WordPress admin bar for non-admin users

İşte bu kadar! Her şeyin yolunda gittiğinden emin olmak için WordPress web sitenizi kontrol etmeyi unutmayın.

Yöntem 3: Yönetici Olmayan Kullanıcılar için Yönetici Çubuğunu Devre Dışı Bırakmak için Ücretsiz Bir Eklenti Kullanın

Web sitenize kod eklemek istemiyorsanız, bir eklenti kullanarak yönetici çubuğunu gizleyebilirsiniz. Hide Admin Bar Based on User Roles, araç çubuğunu farklı kullanıcı rollerine göre kaldırmanıza olanak tanır, bu nedenle çubuğu tüm üyeler, WooCommerce müşterileri veya başka bir kullanıcı rolü için devre dışı bırakmak istiyorsanız bu iyi bir seçimdir.

Öncelikle Hide Admin Bar Based on User Roles eklentisini yüklemeniz ve etkinleştirmeniz gerekir. Daha fazla ayrıntı için, bir WordPress eklentisinin nasıl kurulacağına ilişkin adım adım kılavuzumuza bakın.

Etkinleştirmenin ardından Ayarlar ” Yönetici Çubuğunu Gizle Ayarları sayfasına gitmeniz gerekir. Buradan, yönetici çubuğunu devre dışı bırakmak istediğiniz kullanıcı rollerinin yanındaki kutuları işaretleyin.

Hiding the admin toolbar for specific user roles

Bu işlem tamamlandıktan sonra, ayarlarınızı kaydetmek için ‘Değişiklikleri Kaydet’e tıklamanız yeterlidir.

Umarız bu makale, WordPress yönetici çubuğunu yöneticiler hariç tüm kullanıcılar için nasıl devre dışı bırakacağınızı öğrenmenize yardımcı olmuştur. Ayrıca WordPress’te yazı değişiklikleri için e-posta bildirimlerinin nasıl alınacağına ilişkin kılavuzumuzu ve en iyi WordPress etkinlik günlüğü ve izleme eklentileri uzman seçimlerimizi görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

165 yorumLeave a Reply

  1. I have a Question and Answer plugin on my blog which automatically adds admin bar for all users whenever i make an update on it. I am glad that WPCode has completely disabled this annoying feature. Thanks WPBeginner for the helpful article.

  2. This is very needed to hide the admin bar to all the user’s except the administrator.
    I have thought of doing this multiple times over specially when I was running news website and I had many authors and contributors.
    Showing them admin bar is not only unnecessary but annoying too.
    Really appreciate for the steps to get rid of this admin bar and keep it for only the administrator.

  3. Wow… This is great, you solved an issue I faced with on one of my WordPress website that BuddyPress was installed on….

  4. Using the after_setup_theme hook doesn’t always work. Try this instead:

    function remove_admin_bar( $value ) {
    return ( current_user_can( ‘administrator’ ) ) ? $value : false;
    }
    add_filter( ‘show_admin_bar’ , ‘remove_admin_bar’);

  5. What would be the code if I want to add Editor and Admin to show the Admin bar..

    if (!current_user_can(‘administrator’) && !is_admin())…

    if (!current_user_can(‘editor’) && !is_editor())…

    would it be if (!current_user_can(‘administrator’) && !is_admin() || !current_user_can(‘editor’) && !is_editor())

    would this work?

    • For what you are wanting, you would want to remove: && !is_editor()

      Then it should work how you are wanting.

      Admin

  6. Hi,
    I hide admin bar with plugin You recommend, but when subscriber log in he can still click on “view my profile” and see wp dashboard. Can I disable that?

    • If method 3 is not working for you, we would recommend trying one of the other methods to test.

      Admin

  7. What exactly does this disable? I still see an admin bar and I have access to menu options when I go to example.com/wp-admin when i’m logged into a subscriber account.

    • You would want to ensure the code was properly added for the most likely cause of the admin bar not being hidden otherwise, you could also have a plugin that would be overriding this code.

      Admin

  8. Cannot add the admin code in my theme:

    Communication with the site not possible to check for errors, the PHP adjustment has been reversed. The PHP file change needs to be changed in another way, for example using SFTP.

  9. Hello there…!
    First of all i simply love the work wpbeginner, as you always bring forward the simplest solutions to our wordpress issues. Your website and Youtube channel has always been helpful for me. Thumbs Up for that.. :)

    I had issue with hiding the admin bar for the subscribers only. Now after applying your code in the function.php it is hidden for my editors also.
    Is there any way that my editors also can see the admin bar and only it should be hidden from the subscribers..!!

    • For that, you would need to target another permission that your editor has instead of what we are targeting such as edit_others_posts

      Admin

  10. On my website it says:

    “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”

    What to do now?

  11. Can this code be altered to allow the WordPress Admin bar for Admins AND moderators, but hide it for everyone else?

    Thanks!

  12. If a user knows the URL structure of WordPress he can easily browser to /wp-admin/ and there the admin toolbar will be visible. Also, the easiest way is to deactivate it in the user setting if you have a small number of users.

  13. Doesn’t work. Well, to be fair, works when you first use it but then something happens and it doesn’t anymore. nothing is overwriting the functions.php and the code is there but usually after the first login, logout cycle a subsequent login will see the admin bar return.

  14. I have created a social media site using several plugins and everything works fine but for one issue. Pages are successfully restricted and redirected (Buddypress pages, blogs, etc) for non-logged in users.

    However the main issue I am having is that non-logged in users can still have access to blog posts and user profile pages via widgets placed on side bar and footer and I cannot seem to find a solution anywhere.

    Any ideas on the matter, plugins or code that I can insert in the child theme?

    I have been looking for a solution for over a day and all there is there is how to restrict pages and partial content but nothing works on the widget links, they keep going thru the restrictions in place.

    Thanks

    • Hey Cesar,

      There are several widgets and plugins that allow you to hide widgets from non-logged in users. However, if non-logged in users know the URL, then they would still be able to access those URLs directly. You need to review your plugin settings and see if you can find the option to hide profile pages from non-logged in users.

      Admin

  15. This code or several others that I tried from the comments isn’t working. I’m trying to remove that dumb silver/black wordpress tab above my menu that shows up for all of my website’s users. How do I remove that? Please help :)

    • As mentioned in the article, you included a way for users to edit their profiles through the front end without the admin bar. How did you accomplish that.
      Thanks

  16. Hello, some issue , i have done everything but can’t hide toolbar for owner user in frontend , but can do this for admin user , incredible.
    I’m using search& go theme wordpress , Thank for your help.

  17. Hello,

    Code needs a little updating. This is the code I would use to redirect by role.

    /*Hide admin bar for certain roles*/
    function hide_admin_bar() {
    if(is_user_logged_in() ) {
    $current_user = wp_get_current_user();
    if ( in_array( ‘subscriber’, (array) $current_user->roles ) ) {
    add_filter(‘show_admin_bar’, ‘__return_false’);
    }
    }
    }

    Hope this helps.

    • Thanks for this updated code, Alex. Simple and works great.

      Put it in child theme functions.php and forget about it. :)

    • Thanks, Alex but I’m editing a bit

      /*Hide admin bar for certain roles*/
      if(is_user_logged_in() ) {
      $current_user = wp_get_current_user();
      if ( in_array( ‘subscriber’, (array) $current_user->roles ) ) {
      add_filter(‘show_admin_bar’, ‘__return_false’);
      }
      }

    • Very nice :) but what do I do if I have two roles as a result of bbpress plugin.. That is registered users have the subscriber role in whole site and participant role in bbpress.
      Please help

  18. Hi,

    I inserted your code to remove the Admin bar from my membership site. Unfortunately it also removed it from me, the Admin (even thought I used your first option above). I am using the Tesseract Pro theme. Do you have any suggestions? Thanks

  19. Dear Sir,
    I have 2 admin user and i want to show admin bar for first user and remove admin bar for second user in wordpress.
    How can i do it.

    Thanks for support.

  20. I tried using this and I got that code Parse error: syntax error, unexpected ‘}’ in /home/content/76/10323476/html/wp-content/themes/digitalscience-apex/functions.php on line 168 and I can’t get my site back even after deleting it.

  21. Well, I wouldn’t use current_user_can for that… Codex says, that you can use it for role checking, but in the code you can find:

    * While checking against particular roles in place of a capability is supported
    * in part, this practice is discouraged as it may produce unreliable results.

    So… Much better and secure way to do this is:

    $user = wp_get_current_user();
    if ( ! in_array( ‘administrator’, (array) $user->roles ) ) {

    }

  22. i used it and it crashed my site, trying desperately to fix it now, i took the code back out and updated but I am getting an Error: Parse error: syntax error, unexpected ‘3’ (T_LNUMBER) in /home/lyndalspirit/public_html/wp-content/themes/primer/functions.php on line 516

    • Hi Lyndal,

      Some times when users copy code from websites like WPBeginner, they also copy the line numbers which they are not supposed to copy. When they paste this code in their functions.php file it causes an error.

      You need to connect to your site using an FTP client. Locate your functions.php go to the code you added and remove it. Save your changes.

      Admin

  23. This worked fine for me as-is, i stripped out the line numbers and stuck it at the end of my theme functions.php – instant success. thanks so much.

    • Login to your WordPress admin area using an Administrator account. Click on the Users menu item from the admin sidebar. This will show you a list of users registered on your WordPress site. Locate the user you wish to remove. Click on the Delete link below the username of the person you want to remove.

      Admin

    • JGUISS

      Didn’t worked for me…
      It’s worked with that : add_filter(‘show_admin_bar’, ‘__return_false’);

      how does the code look like with this added I’m not familiar enough with php to add it in

  24. Hello!

    Thank you so much for being such a great help! I installed this code on the function file but it does not seem to work. I loaded my page on a different browser but the Log In bar is still there. Why is that? I also read your article about adding codes to the PHP file.

    I hope you could help me out on this. Thanks!!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.