This detailed step by step tutorial will help anybody who wants to change WordPress theme from database.
After installing new theme or updating it sometimes the conflict occurs between the theme and WordPress or plugins which causes white screen of death error or any other conflict error. This error prevents WordPress users to access WordPress admin area.
Without accessing admin area, it is hard to change the WordPress theme which is conflicting but it is possible to change it from WordPress database.
Access WordPress Database
The WordPress database is generally stored in MySQL Relational SQL database management system. You can access this WordPress database using command line or graphical tool like phpMyAdmin. In this tutorial we will do it using easy to use phpMyAdmin tool whih is free.
You need to log in to your web hosting control panel like cPanel, Plesk etc. to access phpMyAdmin tool.
I demonstrated here using cPanel but the procedure is almost same for other control panels.
After logging in to cPanel and accessing phpMyAdmin tool, select the database of your WordPress site from the database list.
Change WordPress Theme from Database
In the selected WordPress database, click on the wp_options table. In that table find the template and stylesheet options in the option_name column.
To change the theme, click on the option values of template and stylesheet options. In the shared screen the value is ruby which is a theme directory name that have to change to any WordPress default theme directory name like twentyseventeen.
That’s it. The theme is changed to default WordPress theme.
Change WordPress Theme from Database Using SQL Query
Instead of finding and changing values of template and stylesheet options as described above, you can also change it easily by executing following SQL query.
UPDATE wp_options SET option_value = ‘twentyseventeen’ WHERE option_name = ‘template’ or option_name = ‘stylesheet’;
To do this just select WordPress database, add the above SQL query in the SQL tab of database and click on the Go button to execute it.
After executing query, the message “Your SQL query has been executed successfully” will be displayed which means the theme is changed successfully.
If you have any question then just ask it in our free support forum here http://freewptp.com/forum/wordpress-general-forum/