• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Logo

CITROWEB

First choice for your online presence

  • home page
  • Services
    • Web design, web development and consulting
    • Online stores with WooCommerce
    • Technical support for WooCommerce stores
    • Search engine marketing
      • SEO: Your website receives more relevant visitors
      • SEA: Search engine advertising for your website
    • Web hosting packages and domains
  • Blog
  • Contact us
Home » Blog » Hide WordPress admin bar

Hide WordPress admin bar

8. April 2022

If you want to disable the toolbar for your own profile, click on “Users” > “Your Profile” in the top right corner of the WordPress admin interface and then disable the item “Show toolbar for me on the website” in the middle right corner.

Hide WordPress admin bar if page preview

However, if you want to hide the toolbar when previewing a page that is being edited, this can be solved with the following code:

add_filter( 'show_admin_bar', 'show_admin_bar_if_not_preview' );
function show_admin_bar_if_not_preview($show_admin_bar) {
	return ( is_preview() ) ? false : $show_admin_bar;
}

Hide WordPress admin bar for all users

add_filter('show_admin_bar', '__return_false');

Filed Under: development, WordPress

Primary Sidebar

Search

Recent Posts

  • Remove “Thank you for your trust in WordPress” from the bottom of the dashboard
  • Remove WordPress logo from toolbar
  • Change login cookie lifetime in WordPress
  • WordPress multisite and cookie settings in wp-config.php
  • Update GUIDs in WordPress after domain move

Footer

Logo




© 2023 CITROWEB
  • Data protection
  • imprint
  • Deutsch