WordPress is easy to use CMS if compared to others. It gives lots of functionality when talking about themes. We can change, upload, or add new in just a few clicks. Also, you change WordPress theme in the database or via phpMyadmin easily.
Sometimes the theme becomes a corrupted file and in that situation, we are unable to access the admin area or the whole website.
The theme gets corrupted when we update or install a new plugin/theme. And we get a blank screen.
If you met such a situation, you need to find other ways to fix the problem.
In this article, I am going to show you how to change the theme from database or phpMyAdmin.
Or you can watch the video.
Why and When To Use phpMyAdmin
As said earlier, the easiest way to switch between themes is by using WP Dashboard section.
There may be few reasons why you should change WordPress theme from the database.
In many cases, we can recover the whole things by restoring the backup. Another way to do that is by troubleshooting the whole themes folder.
You can easily connect to your website through FTP and download the themes from themes folder.
After downloading you can delete all themes except default theme ‘TwentySixteen’.
Then the WordPress will automatically change your theme to the default and you will be able to access the dashboard again.
But the best way to change the WordPress theme is by using phpMyAdmin.
You don’t need to be a programmer for doing that task. You can easily do the process using the database.
Changing theme via phpMyAdmin
If you have lots of websites hosted on the single hosting plan, then it may be difficult for you to find the right database.
In order to find the right database, there is a simple trick.
Just go to the website folders where you are getting problems and find the file
wp-config.php There check the DB_NAME.
Open the database and access the database.
After accessing phpMyAdmin, choose the database and click the wp-options table.
Once the table is opened locate the row ‘template’ and ‘stylesheet’. In most cases, these rows are found in the 2nd page of the database. It may vary if you have a huge number of plugins installed.
There double click on the value or just click that row. Then change the name to the theme you want the switch to.
Remember the name should of themes folder name not the name in style.css. Do the same process to the stylesheet row and set name to the themes folder you wish to activate.
Now check whether the settings affected the site or not by just visiting your WordPress dashboard and website as well.
Hope this article helped in changing the theme from the database or via phpMyAdmin.
Please have your valuable suggestions below and show some love by sharing the content.