Code instructions :

Open your current activated theme’s functions.php page & simply copy and paste the bellow code at the bottom of your page for hide the admin bar to all logged in users except admins. This is very useful for those sites that have public registration and login turned on.