How to Activate or Change WordPress Theme from Database

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.

cPanel Login Screen
cPanel Login Screen

I demonstrated here using cPanel but the procedure is almost same for other control panels.

cPanel phpmyadmin
cPanel phpmyadmin

After logging in to cPanel and accessing phpMyAdmin tool, select the database of your WordPress site from the database list.

Select WordPress Database
Select WordPress Database

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.

Find Template Stylesheet Options
Find Template Stylesheet Options

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.

Change WordPress Theme from Database
Change Template Stylesheet Options

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.

Change WordPress Theme From Database Using SQL Query
SQL Query in Database

After executing query, the message “Your SQL query has been executed successfully” will be displayed which means the theme is changed successfully.

Executed SQL Query
Executed SQL Query

If you have any question then just ask it in our free support forum here http://freewptp.com/forum/wordpress-general-forum/

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.