Dukeo » WordPress » Disable Theme Changing: How To do This on Your WordPress Blog

Disable Theme Changing: How To do This on Your WordPress Blog

Steven 2 responses WordPress

If you are developing a website based on the WordPress content management system for another company or individual, you may need to prevent them from switching themes.

To make sure your client won’t be able to switch theme, you need to paste the following code in the functions.php file in your WordPress theme folder:

add_action('admin_init', 'dukeo_lock_theme');
function dukeo_lock_theme() {
  global $submenu, $userdata;
  get_currentuserinfo();
  if ($userdata->ID != 1) {
    unset($submenu['themes.php'][5]);
    unset($submenu['themes.php'][15]);
  }
}

That’s all you need to do! Easy enough?

If you enjoyed this article,
Get email updates

Join for Free »

2 Comments

  1. Charlie

    This is really what I want.

    Thanks Steven :)

    1. You’re welcome !