Get my FREE ebook:
"SEO FOR BLOGS: The Ultimate Guide"
Limited Time Offer!

How To Disable Theme Changing On Your WordPress Blog

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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?

Commenting Contest
If you enjoyed this article, Get email updates
(It's Free)
Sté Kerwer
Post written by: Sté Kerwer
Bonjour from France. My name is Stéphane Kerwer and Dukeo.com is my blog. I do most of the heavy lifting in here but from time to time, you may see some guest posts. If you wish to receive updates about Dukeo, subscribe to RSS Feed, follow Dukeo on twitter or become a fan on Facebook.
2 Comments
  1. This is really what I want.

    Thanks Stéphane :)

arrow