There are times when there is problem in your theme that you have installed in your site and your site goes blank or white. In this situation you will not be able to log in to the WordPress Admin area. In this situation you can simply use the database to choose the default theme and solve the problem.
Step 1: It is highly recommended to backup your database before your work on any database command.
Step 2: Login to your database using phpMyAdmin (or whatever), Click on your database and click on the SQL tab and enter the following SQL query:
UPDATE wp_options SET option_value='default' WHERE option_name='template' OR option_name='stylesheet' LIMIT 2;
This query will change the wordpress theme to default.
10 thoughts on “Choosing Default WordPress Theme through database”
I have to say from the bottom of my heart, you done well with this post, very useful stuff.
Finding good information from blogs is not always easy, but you have done a great job here, interesting title ( Choosing Default WordPress Theme through database | Sakin Shrestha > Management and IT Consultant (WordPress Expert) ) too, cool.
Saved the day. Activated a child theme that then whipped things out. Deleted child theme, then parent theme, and still nothing. This worked wonders. Thanks a million!
Very nice solution. I was’nt getting any solution before and I was going to drop the database finally. Thanks Sakin.
It’s Very nice Article for install wordpress manually.
Above link also help you for install wordpress manually
Many Thanks for kind help. It was really helpful as my site was doWn after changing server and doing this I was able to login !!! Once again Many Thanks – Mukesh Vadodaria – INDIA
Thank you. With a few tweaks (db prefix and changing the name of the template) I was able to restore my site. Exactly what I was looking for.
Thanks, this is very helpful to rescue my shop. Wondering to have a simple script to execute it whenever we need a fallback
Many thanks for sharing this, after moving my files and database over to a new server the theme somehow broke, but running this code get my website up again.
Awesome script!! A couple of things to add. If you have a security plugin like I do that changes the table prefix then you will have to change the wp_options to whatever prefix is used in your db. in my case “wpfn_options”. And their is no theme called “default” that I know of. FTP to your site and look at the directory names under /wp-content/themes. Pick the directory name (which are theme names) that you want to be the theme you change to in the script. Use THAT name instead of “default”
Comments are closed.