How to easily disable theme changing

May 3, 2011 at 2:38 pm

When creating a WordPress based website for a client, you may need to make sure that he can’t switch themes. This is what I’m going to show you in today’s recipe.

Simply paste the following piece of code in your functions.php file:

add_action('admin_init', 'slt_lock_theme');
function slt_lock_theme() {
	global $submenu, $userdata;
	if ($userdata->ID != 1) {

Once saved, your client will not be able to switch themes anymore.

Thanks to Steve Taylor for this cool recipe!