Marketing Tips, Hacks, & Cheat Sheets >>      

Remove Search Box on WordPress Admin Bar

I wanted to disable the search box on my WordPress Admin Bar that’s found on the far right of the toolbar.

Here’s the code I used (and where I added it) to make this happen:

  1. Access your active WordPress theme and open the functions.php file.
  2. Paste the code snippet below into the file, and save!
Select Code
1
2
3
4
5
6
7
8
/*
 * Disable the Search Icon and Input within the Admin Bar
 */
function disable_bar_search() {
	global $wp_admin_bar;
	$wp_admin_bar->remove_menu('search');
}
add_action( 'wp_before_admin_bar_render', 'disable_bar_search' );
Throwback Thursday!
Exclude Digg Digg From Select Pages




MarketingChick.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.

Send this to friend