How to show WordPress admin toolbar to all users

Sometimes it’s handy to show the WordPress admin toolbar to everyone, not just users that are logged in.

In my case I’m working on a plugin that will allow visitors to select between themes to view a site and the toolbar seems like the most logical place to put that.

Fortunately, it’s really easy. Just open up the functions.php file for your theme and add the following.

show_admin_bar(true);

Save the file, and done. The admin bar will show up.

For a visitor they should see the WordPress logo along with a menu for WP related stuff and a search icon on the far right. Eventually I’d like to get the WordPress menu swapped out with something else, but for now it’s a start.

Leave a Reply