When setting up a self-hosted WordPress site, you’ll be using a theme. I always start building my site with a pre-made basic theme such as the default WordPress theme. But then I make adjustments to that theme to fit my exact website, and I typically do so not as a child theme as described in this article, but actually by editing the theme itself. The biggest issue that arises with this methodology is when the base theme you used gets updated, it will overwrite all of the wonderful changes you’d already made to your site. Luckily, there is an easy way around this! Here are the four easy steps to renaming an existing theme to prevent it from updating:
1. Make an exact copy of the theme you plan on changing. The easiest and best way of doing this is using an FTP program like Filezilla. After you’ve already setup WordPress on your site, and installed the theme you are interested in, then go find that folder in your server files. The themes are located wp-content -> themes. Download the theme folder to your desktop rename the folder to your desired theme name.
2. Change a few lines of code in the style.css file. Now that you’ve got a “new theme”, you’ve actually got to change a few files so that WordPress recognizes it as a new theme. The only meaningful file change is the style.css file (which must keep the name of style.css), which references the theme name that WordPress uses. Here is an example of the commented code that needs to exist at the top of your style.css file. If you want, you can keep everything the exact same, just change the theme name to your new theme name.
/* Theme Name: YOUR_NEW_THEME_NAME_HERE Theme URI: YOUR_WEBSITE_URL Description: DESCRIPTION_OF_YOUR_THEME Version: 1.0 Author: YOUR_NAME Author URI: YOUR_WEBSITE_URL Tags: FOR_WP_THEME_SEARCH_IF_PUBLISHED */
3. Change a few lines of code in all the remaining files. In almost all of the remaining files, you’ll see something similar to the code below. This is an optional step, but you might as well be thorough and just update all the files to have your new theme name.
<?php /** * @package WordPress * @subpackage YOUR_NEW_THEME_NAME_HERE */ ?>
4. Create a screenshot for the WordPress theme selection page. You might notice inside the folder you downloaded, there is a screenshot.png file. This is the image that shows up in the theme selection interface in your website’s WordPress administration. Make a new screenshot of what your theme actually will look like. The image should be 300 pixels wide by 225 pixels tall. If you are curious, this is the screenshot I did for my own adjusted theme (yes, I used the process described above myself).
5. Upload and install your new theme. Once you are done with steps one through four, you can upload your new theme into the same themes folder you downloaded it out of originally. Once that is done, if you go to the WordPress administration interface for selecting the active theme, you should see your new theme as an option, in addition to the currently selected original theme you had been using. Pick your new theme for the site, and you are all set to go. You’ve got a fully functional theme that won’t get overwritten, no matter how many changes you make!