Remove admin bar from WordPress site

Is the WordPress admin bar distracting you when you are viewing your website as a logged-in user? Or does the admin bar break your custom theme (fixed navbar being one of the most common issues)?

To remove the admin bar permanently from the frontend of your WP site, and for all users, put this line in the functions.php of your theme:

add_filter('show_admin_bar', '__return_false');

If you’d like to hide the bar only for yourself, there is a setting for this in the admin panel:

Users > Profile > Toolbar > Show Toolbar when viewing site