Skip to content

Instantly share code, notes, and snippets.

@deavy
Created May 6, 2018 10:44
Show Gist options
  • Save deavy/764ede0015ef903ff1a18b5f96e893b4 to your computer and use it in GitHub Desktop.
Save deavy/764ede0015ef903ff1a18b5f96e893b4 to your computer and use it in GitHub Desktop.
Hide Personal Options section from Wordpress Profile screen with CSS only
function hide_personal_options() {
$screen = get_current_screen()->id;
if ($screen === 'user-edit') {
echo "<style type='text/css'>
#your-profile h2:first-of-type,
#your-profile h2:first-of-type + table {
display: none;
}
</style>";
}
}
add_action('admin_head', 'hide_personal_options');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment