Recommended Method
You don’t have to change anything in the database. Follow these steps:
-
Activate a default WordPress theme (e.g.
twentyseventeen
) – that is any theme other than the child theme you are going to rename. -
Rename your child Themes folder name and child theme’s name in
style.css
file. -
Now activate the child theme.
That’s all, WordPress will update related info. in the Database autometically.
Note: You’ve already figured out step-2 correctly. Just need to follow step-1 before step-2 and then step-3 afterwards. That’s all.
Database Method:
It’s also possible to change the theme name from the database after following step-2 above. Sometimes it’s helpful in case you’ve already changed the theme name & now can’t access the site because WordPress has a different theme name in the Database.
In this case, know that WordPress saves two values in the wp_options
table. One is with the option_name
= stylesheet
and the other one is the option_name
= template
.
If it’s not a child theme, then both the values are same. For a child theme however, option_name
= stylesheet
will have option_value
= your-current-child-theme-name
and option_name
= template
will have option_value
= parent-theme-name
.
So if you change these two values accordingly, it’ll work as well. You can use PHPMyAdmin, or the following MySQL query:
update wp_options set option_value="new-child-theme-name" where option_name="stylesheet";
update wp_options set option_value="parent-theme-name" where option_name="template";
replace
new-child-theme-name
andparent-theme-name
accordingly in the above query.