Generic selectors
Exact matches only
Search in title
Search in content
Filter by Categories
Digital Marketing
Email Marketing
Entrepreneurship
Oxygen Builder
Search Engine Optimization
Social Media Marketing
Web Design & Development
Web Strategy
WordPress

PHP Snippet Remove Specific Items from The WordPress Toolbar

Managed by:
Mohammed Wasim Akram
Snippets Categories:

If you want to remove specific items from the WordPress Toolbar to declutter it and make things organized then this code snippet would help you achieve just that.

/* Advanced Scripts Method to Add This Snippet */
/* 
Title: Remove WordPress Toolbar Items
Type: PHP: Custom Code
Location: Plugins Loaded
Priority: 10
*/

function syncwin_remove_toolbar_nodes($wp_admin_bar) {
	
	$wp_admin_bar->remove_node('wp-logo');
	$wp_admin_bar->remove_node('stats');

}
add_action('admin_bar_menu', 'syncwin_remove_toolbar_nodes', 999);

How to Add The Snippets?

There are multiple ways of adding snippets to your site, but we prefer using the Advanced Scripts plugin as it allows adding various types of codes to your site such as PHP, JavaScripts, CSS etcetera.

Apart from that, the developers behind this plugin are very talented and they constantly keep improving the plugin also adding new features whenever possible, and the best part is that they are doing it all based on the feedback of the actual users which simply means that they care.

You could also use the Code Snippets plugin as it is also a great option for free but limited in features and capabilities as compared to Advanced Scripts.

Want to Contribute?

If you want to contribute by improving the existing snippets or by sharing new snippets, then feel free to contact us either through our Contact Page or Facebook Messenger.

We would be happy to mention you as a contributor and link back to your website or any social media profile you like.

Please Note: we would only accept the contribution if the snippet is successfully working on your project which you have to prove by sharing necessary links.

Disclaimer

I would suggest you test these snippets on your staging site and when you think they work, then you try them on your live site as it's not our responsibility if something goes wrong with your site.

Although they work well for me and the other people still you should be extra cautious and careful to implement any code snippet on your site due to different stack of tools and backend environments.

Affiliate Disclaimer

Please note I want to keep things crystal clear that this page may contain some of our affiliate links. Also, we don't know, use or recommend every product we link to, so please do your due diligence before buying them.

However, there are very few selected products that we trust, use, and recommend to our readers and community, and we always mention that on our website which you could also find on our Recommendation Page.

Hence, if you make a purchase using any of those links, then it is safe to assume that we might get a small amount of commission without any additional cost to you, which helps and encourages us to produce more helpful content like this for you.

Feel free to explore our Legal Policy Pages

Leave a Comment

Top arrow-circle-o-downmenu-circlecross-circlechevron-down-circle linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram