Last Updated: February 25, 2016
·
552
· sugarskull

Changing the Wordpress theme name through Terminal / MYSQL

If you end up deleting your theme and theres an error thrown, you might end up with a MYSQL entry for a theme that doesn't exist or broken.

Check the current value

SELECT * FROM wp_options WHERE option_name = 'template' OR option_name = 'stylesheet' OR option_name = 'current_theme';

Run this command on your MYSQL to replace

UPDATE wp_options SET option_value = 'twentyfourteen' WHERE option_name = 'template';

UPDATE wp_options SET option_value = 'twentyfourteen' WHERE option_name = 'stylesheet';

UPDATE wp_options SET option_value = 'Twenty Fourteen' WHERE option_name = 'current_theme';

Verify

SELECT * FROM wp_options WHERE option_name = 'template' OR option_name = 'stylesheet' OR option_name = 'current_theme';

Should Provide

+-----------+---------------+----+----------+
| option_id | option_name   | option_value    | autoload |
+-----------+---------------+-------+-------+
|       156 | current_theme | Twenty Fourteen | yes      |
|        42 | stylesheet    | twentyfourteen  | yes      |
|        41 | template      | twentyfourteen  | yes      |
+-----------+----------- ----------+----------+