Renaming a WordPress theme involves changing both the theme's folder name and the name declared within its primary stylesheet file (style.css
). This ensures WordPress recognizes the theme correctly under its new identity.
Here is a step-by-step guide on how to rename your WordPress theme:
Step 1: Access Your WordPress Files
You need access to your WordPress installation files. This can typically be done via:
- FTP (File Transfer Protocol): Using clients like FileZilla, Cyberduck, etc.
- File Manager: Provided within your web hosting control panel (like cPanel, Plesk, etc.).
Step 2: Navigate to the Themes Folder
Once connected, you will need to find your themes directory.
- Navigate to the
wp-content/themes
folder. This is the standard location where all your installed themes reside.
Step 3: Rename the Theme Folder
Locate the folder corresponding to the theme you wish to rename. Its name will typically be the current name of your theme or a slug derived from it.
- Rename the folder which contains your theme name, to the name you wish. Choose a simple, lowercase name, often using hyphens instead of spaces (e.g.,
my-new-theme-name
).
Important: Renaming the folder alone is not enough. WordPress reads theme information from the style.css
file inside this folder. If you only rename the folder, the theme might show up as broken or still display the old name.
Step 4: Edit the Theme's style.css
File
After renaming the folder, you must edit the theme's main stylesheet (style.css
) to update the theme information WordPress displays.
- Return to the WordPress Admin panel and navigate to the Appearance → Editor subtab.
- In the Theme File Editor, ensure the correct theme is selected in the dropdown menu on the top right (it might show the old name initially or be listed with its new folder name).
- Find and click on
style.css
in the list of theme files on the right side. - Locate the theme header block, which looks something like this:
/*
Theme Name: Old Theme Name
Theme URI: http://example.com/
Author: Theme Author
Author URI: http://example.com/
Description: A brief description.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: flexible-header, custom-colors
Text Domain: old-theme-name
*/
- Change the line that says
Theme Name:
to your new desired theme name.
For example:
Old Header | New Header |
---|---|
Theme Name: Old Theme Name |
Theme Name: My New Theme Name |
You may also want to update other details like Theme URI
, Author
, Description
, and potentially Text Domain
(if applicable and you plan on changing localization strings).
- Click the "Update File" button to save your changes.
Step 5: Verify the Change
Go to Appearance → Themes in your WordPress Admin panel. Your theme should now be listed with its new name.
Additional Considerations:
- Child Themes: If you were using a child theme of the one you renamed, you might need to edit the child theme's
style.css
file and update theTemplate:
line to match the new folder name of the parent theme. - Database Entries: Some themes or plugins might store settings related to the theme name or folder name in the database. Simple renaming might not update these, potentially requiring more advanced steps depending on the theme. However, for a basic rename, changing the folder and
style.css
is usually sufficient for WordPress to recognize the theme.
By following these steps, incorporating the necessary folder renaming and editing the style.css
file as guided by the reference points, you can successfully rename your WordPress theme.