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

Steven2 responsesWordPress

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?

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

2 Comments

  1. Charlie

    This is really what I want.

    Thanks Steven :)

    1. You’re welcome !

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money