According to a WordPress.org support thread, it’s very easy to remove the Themes and Editor sub-pages entirely, making it (nearly) impossible to change themes. Drop this in your functions.php file:
/**
* Remove the 'Themes' submenu page.
*
* @link http://codex.wordpress.org/Function_Reference/remove_submenu_page
*
* @return void
*/
function remove_theme_submenu() {
remove_submenu_page('themes.php', 'themes.php');
remove_submenu_page('themes.php', 'theme-editor.php');
}
add_action('admin_init', 'remove_theme_submenu', 100);
If you want to remove the Themes sub-page for everyone except you, place this in your functions.php file (replace admin
with your username):
/**
* Remove the 'Themes' submenu page for everyone but the 'admin'.
*
* @link https://codex.wordpress.org/Function_Reference/wp_get_current_user
* @link http://codex.wordpress.org/Function_Reference/remove_submenu_page
*
*
* @return void
*/
function remove_theme_submenu_except_admin() {
$current_user = wp_get_current_user();
if ($current_user->user_login !== 'admin') {
remove_submenu_page('themes.php', 'themes.php');
remove_submenu_page('themes.php', 'theme-editor.php');
}
}
add_action('admin_init', 'remove_theme_submenu_except_admin', 100);
I should mention that I tested this against WordPress 3.9. Works like a charm.