How to disable WordPress admin bar

Here is a quick tip to disable admin bar in WordPress

[code]
/*
Disable the WordPress Admin Bar for all Users and Visitors
*/
remove_action( ‘init’, ‘_wp_admin_bar_init’ );
[/code]

[code]
/*
Enable the WordPress Admin Bar for admins only
*/
if ( !current_user_can( ‘manage_options’ ) ) {
remove_action( ‘init’, ‘_wp_admin_bar_init’ );
}
[/code]

I am a Technical consultant with over 16 years of experience in developing, leading, and consulting on various web and mobile applications for startups and businesses. My core competencies include open-source frameworks, PHP, Marketo, WordPress and Digital Marketing Strategy. I am also a certified Microsoft Professional and a graduate of the Executive Program in Digital and Social Media Marketing from IIM Raipur. I lead a team of talented and passionate developers, designers, and marketers who deliver innovative and impactful solutions for our clients. We work with the latest technologies and methodologies, such as AI, cloud computing, agile, and DevOps, to create user-friendly, scalable, and secure products that meet the needs and expectations of our customers.

More Posts - Twitter - LinkedIn - Google Plus