How to Disable Theme Switching

Sometimes it’s useful to remove some WordPress options for clients. After all – they’d just muck it up right?

If you’ve designed a bespoke WordPress theme for a website and want to disable theme switching, add the following code to your functions.php file.

[gist id=8143123 file=code-snippet-1.php]

This will hide the Themes tab for all users except for the first user in the database which is usually the Administrator user you used at setup (ID=1).

If you want to restrict the option to another user, just change the ID # on line 5.

Was this article helpful?
YesNo