Visitor retention is one of the important aspect to improve the website visibility. To achieve it some website allows their visitors to register. In WordPress also, visitor can register themselves with the visiting site if the registrations are open.

After registering, WordPress, by default, shows a admin bar for each of it’s registered visitor with the different options available. Although it is not always useful to each visitor and sometimes owner don’t want to show the admin bar to it’s visitor to improve the user experience.

It can be achieved adding following piece of code in the file ‘functions.php’ of the active theme:

After adding the above code, admin bar will not be visible to the visitors who will not have the management roles. It will not have any effect on the flow of the website and everything will go smooth.

If a registered visitor wants to checkout it’s dashboard then it can be easily accessed using the following link:

http://www.example.com/wp-admin

Note: replace example.com with your website domain.

Some plugins are also available where you can provide better user experience for registered visitors with custom membership page.

HomeCodingHow-to GuideWordpressHow to remove admin bar in WordPress