WP prevent theme switching

08.Jul.2010

If you want to prevent client from switching WP theme by accident, use this WP snippet, brought to you by SoulSizzle design. Just put this code into your functions.php file, and users won’t have an option to switch theme in WP.

1
2
3
4
5
6
7
add_action('admin_init', 'remove_theme_menus');
function remove_theme_menus() {
	global $submenu;
 
	unset($submenu['themes.php'][5]);
	unset($submenu['themes.php'][15]);
}