Preventing a WordPress Theme from Updating
Sometimes developers like to hack a theme and then refactor the modification later, so you need to disable a WordPress Theme from updating and overwriting your changes.
Sometimes developers like to hack a theme and then refactor the modification later, so you need to disable a WordPress Theme from updating and overwriting your changes.
There’s probably a few ways to disable the update, but this method is easy to do and easy to remove. It may come as a surprise that all you have to do is to edit the theme’s style sheet.
If you log on as ADMIN, use the left menu to navigate Appearance -> Editor and when you are in that screen look for Stylesheet (style.css) on the bottom right. Click on that and you can edit it in the box.
The top of the stylesheet will have an header very similar to this:
/***** Theme Name: My Theme Theme URI: http://makeitspendit.robotcody.com Description: My theme etc, etc. Author: Someone Author URI: http://makeitspendit.robotcody.com Version: 1.5.2 Tags: one-column, custom-menu, full-width-template Text Domain: my-theme Domain Path: /languages/ License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Credits: You may remove the link in the footer. *****/
This is where WordPress gets its information from so don’t hack it too much. It will tell you there’s a newer version (and maybe automatically update it) if the Version number is lower than that of the new version.
So all you need to do it make the version number big. In the above example I would change 1.5.2 to 9991.5.2. It won’t reach that number so you should be safe – but always take copies!
I usually amend the theme name too, to something like ‘My Theme [UPDATED do not overwrite]‘. That message will display in the Admin section to remind you and warn others that you have made a change.
Let’s have a bit of a warning, because that’s not really how to do things in WordPress. Upgrades are not only new features and cosmetic improvements, they include bug fixes and maybe more importantly, security patches. WordPress is a big target these days and third-party themes and plugins can introduce many security problems. Disabling upgrades means that you are rejecting these – maybe critical – improvements.
WordPress has built a huge community because of its expandability through its modular design and hooks. If you want to make additions or changes then learn how to do them correctly in the WordPress framework. Hacks to core files, themes and plugins should be kept to experimental and development servers only.
Also check that the license of your theme allows you to make changes and distribute them as you have need to.