Device-Based Admin Bar Visibility

Controlling the admin bar based on the visitor’s device improves the mobile experience and simplifies the frontend for different screen sizes.

With Hide Admin Bar Pro, you can hide or show the WordPress admin bar depending on whether the user is on a mobile, tablet, or desktop device.

Common Use Cases #

  • Hide admin bar for mobile users to avoid clutter on small screens
  • Show admin bar only on desktop for backend-heavy workflows
  • Create a cleaner frontend for tablet users while keeping backend accessible

How to Configure Device-Based Visibility #

1. Open Plugin Settings #

Go to:
Settings → Hide Admin Bar

2. Locate the “Device-Based Visibility” Section #

This section is available only in the Pro version.

You will see checkboxes for:

  • Mobile
  • Tablet
  • Desktop
hide-admin-bar-based-on-user-roles-device-visiblity

3. Select the Devices Where You Want to Hide the Admin Bar #

For example:

  • Select Mobile to hide admin bar for mobile visitors
  • Select Tablet if needed

Leave unchecked for devices where you want the admin bar to remain visible.

4. Save Changes #

Click Save Changes to apply your device targeting rules immediately.


Technical Details #

  • The plugin uses the visitor’s User-Agent to detect device type.
  • Detection includes most popular mobile and tablet devices.
  • Device detection is lightweight and does not impact site performance.

Tips #

  • You can combine device-based rules with role-based rules for more targeted control.
  • Always test your setup by visiting your site from an actual device or using browser emulation tools (e.g., Chrome DevTools Mobile View).

FAQ #

Is device detection accurate?
Yes, the plugin uses lightweight User-Agent parsing compatible with modern devices.

What if a device is misclassified?
Rarely, complex user agents might mislead basic detection. If precision is critical, a server-side device detection plugin can be combined.

Can I show admin bar only on mobile?
By selecting “Desktop” and “Tablet” but leaving “Mobile” unchecked, the admin bar will only be visible on mobile.

What are your feelings
Updated on April 19, 2025