Skip to content

Instantly share code, notes, and snippets.

@JPry
Last active January 19, 2022 20:52
Show Gist options
  • Save JPry/2399805 to your computer and use it in GitHub Desktop.
Save JPry/2399805 to your computer and use it in GitHub Desktop.
Remove WP Engine info from WP Dashboard
<?php
// Remove all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine"
$user = wp_get_current_user();
if ( $user->user_login != 'wpengine' ) {
add_action( 'admin_init', 'jpry_remove_menu_pages' );
add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 );
}
/**
* Remove the WP Engine menu page
*/
function jpry_remove_menu_pages() {
remove_menu_page( 'wpengine-common' );
}
/**
* Remove the "WP Engine Quick Links" from the menu bar
*/
function jpry_remove_admin_bar_links( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'wpengine_adminbar' );
}
?>
@ehoanshelt
Copy link

This is great. Here is a modification I came up with if you would like to share:

user_login, $users_allowed)) { add_action( 'admin_init', 'jpry_remove_menu_pages' ); add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 ); } /** - Remove the WP Engine menu page */ function jpry_remove_menu_pages() { remove_menu_page( 'wpengine-common' ); } /** - Remove the "WP Engine Quick Links" from the menu bar */ function jpry_remove_admin_bar_links( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'wpengine_adminbar' ); } ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment