Problem: People makes SharePoint branding inconsistent by creating and applying random themes and breaks corporate branding. So need to stop users from creating & uploading new themes and applying them.
Solution:
Hide Themes and Site Themes links with "HideCustomAction" from Site Settings!
Some time back, I created a feature to Hide "Delete this site" link from Site settings. Lets re-use the same trick to build a feature to hide "Themes" link from site settings page from everyone. Lets gets started.
1. Create New "Empty SharePoint Project" in Visual Studio 2010. Give it a name. Say: Crescent.TeamSite.HideThemes. Make it a Farm Solution.
Image may be NSFW.
Clik here to view.
2. Add a Feature to the project by right clicking "Features" node in the Solution Explorer, Add Feature
3. Add new Module to the Project, by Right clicking the project Crescent.TeamSite.HideThemes from solution explorer and choose "Add >> New Item", Give it a name. Say: HideThemes
Image may be NSFW.
Clik here to view.
Now the project structure should look like:
Image may be NSFW.
Clik here to view.
4. Update the Elements.xml file inside module we created:
Element.xml file should look like:
5. Go to the Feature Designer: Right Click "HideThemes" under Features node, choose "View Designer"
6. Provide name to the feature, as: "Hide Themes in Site Settings", set the scope as Site and include the Module we created "Hide Themes Module"
7. Build and deploy the Project
8. Activate the Feature: Go to Site actions >> Site Settings >> Site Collection Features >> Click on Activate next to "Hide Themes in Site Settings"
Image may be NSFW.
Clik here to view.
and the Result: See that the "Themes" link is hidden under Galleries!
Image may be NSFW.
Clik here to view.
Finally, We made the feature hidden, Activated for required site collections and we are done!
Refer MSDN to get Default Custom Action Locations and IDs
Disable Themes for All Sites in a Web Application
To stop users from applying themes at web application level, We can simply disable the web application user permissions "Apply Themes and Borders - Apply a theme or borders to the entire Web site." by going to: Central Administration >> Application Management >>Manage Web Applications >> Select the desired web app >> Click on "User Permissions" from Ribbon
However, this will disable all users including farm administrator from applying themes and give error message "Attempted to perform an unauthorized operation." when they try to apply themes. There is a another way to disable themes by editing "SPTHEME.XML" file from 14 hive, which is not recommended!
But the actual requirement is to not to disable themes in all site collection of the web application. Now the question is: How to stop users from accessing "Themes" and "Site Themes" links on particular site collection(s)? So we made the feature, and activated wherever required.Image may be NSFW.
Clik here to view.
Solution:
Hide Themes and Site Themes links with "HideCustomAction" from Site Settings!
Some time back, I created a feature to Hide "Delete this site" link from Site settings. Lets re-use the same trick to build a feature to hide "Themes" link from site settings page from everyone. Lets gets started.
1. Create New "Empty SharePoint Project" in Visual Studio 2010. Give it a name. Say: Crescent.TeamSite.HideThemes. Make it a Farm Solution.
Image may be NSFW.
Clik here to view.

2. Add a Feature to the project by right clicking "Features" node in the Solution Explorer, Add Feature
3. Add new Module to the Project, by Right clicking the project Crescent.TeamSite.HideThemes from solution explorer and choose "Add >> New Item", Give it a name. Say: HideThemes
Image may be NSFW.
Clik here to view.

Now the project structure should look like:
Image may be NSFW.
Clik here to view.

4. Update the Elements.xml file inside module we created:
<HideCustomAction GroupId = "Customization" HideActionId = "Theme" Location = "Microsoft.SharePoint.SiteSettings"> </HideCustomAction><HideCustomAction GroupId = "Galleries" HideActionId = "Themes" Location = "Microsoft.SharePoint.SiteSettings"></HideCustomAction>
Element.xml file should look like:
5. Go to the Feature Designer: Right Click "HideThemes" under Features node, choose "View Designer"
6. Provide name to the feature, as: "Hide Themes in Site Settings", set the scope as Site and include the Module we created "Hide Themes Module"
7. Build and deploy the Project
8. Activate the Feature: Go to Site actions >> Site Settings >> Site Collection Features >> Click on Activate next to "Hide Themes in Site Settings"
Image may be NSFW.
Clik here to view.

and the Result: See that the "Themes" link is hidden under Galleries!
Image may be NSFW.
Clik here to view.

Finally, We made the feature hidden, Activated for required site collections and we are done!
Refer MSDN to get Default Custom Action Locations and IDs
Additional Tip: Use IE Developer Toolbox or Firefox FireBug to Get the GroupID and HideActionID values.
Disable Themes for All Sites in a Web Application
To stop users from applying themes at web application level, We can simply disable the web application user permissions "Apply Themes and Borders - Apply a theme or borders to the entire Web site." by going to: Central Administration >> Application Management >>Manage Web Applications >> Select the desired web app >> Click on "User Permissions" from Ribbon
However, this will disable all users including farm administrator from applying themes and give error message "Attempted to perform an unauthorized operation." when they try to apply themes. There is a another way to disable themes by editing "SPTHEME.XML" file from 14 hive, which is not recommended!
But the actual requirement is to not to disable themes in all site collection of the web application. Now the question is: How to stop users from accessing "Themes" and "Site Themes" links on particular site collection(s)? So we made the feature, and activated wherever required.Image may be NSFW.
Clik here to view.