Recently, one of our readers asked us if he could change his WordPress theme from the database. WordPress makes it easy to manage dashboard themes. However, if you are unable to access your WordPress dashboard, you will need to find other ways to modify your WordPress theme. In this tutorial, we will show you how to easily change your WordPress theme via phpMyAdmin.

Change the WordPress theme of phpMyAdmin

Why and when to use phpMyAdmin?

Normally the easiest way to change your WordPress theme is to visit the page Appearance »Themes on your WordPress dashboard. However, sometimes a WordPress error can make the dashboard inaccessible.

In this case, the safest way to restore your Website is to restore it from backup. Another way is to fix the WordPress error causing the problem. When it comes to troubleshooting, the easiest way to change themes is to make a backup of your existing theme via FTP, then delete all folders and themes from /wp-content/themes/ except for the default theme . WordPress will automatically revert to the default theme.

The two methods above will give you access to the WordPress dashboard, and you will be able to change the theme.

However, if you don't have a backup and don't want to revert to a default theme, you can use a custom WordPress theme from your database using phpMyAdmin.

That being said, let's look at how to change your WordPress theme via phpMyAdmin.

Change your WordPress theme via phpMyAdmin

This method allows you to tell WordPress which theme to use by changing the information in the database. For this method to work, the theme you want to use must already be installed on your Website.

You will need to log in to your Website using an FTP client and go to the /wp-content/themes/ folder. There you will be able to see all the themes that are currently installed on your website.

WordPress Themes Folder

Note: Write down the name of the theme folder you want to use. You will need it in the next step.

If the theme you want to use is not installed on your website, you can manually install a WordPress theme via FTP .

After making sure the theme you want is installed on your website, you can now go ahead and change the theme via phpMyAdmin.

First, you need to go to the cPanel dashboard of your account accommodation WordPress. Next, scroll down to the Databases section and click on phpMyAdmin.

go to phpmyadmin.jpg

Once you are in phpMyAdmin you will see a list of databases on the left side of the screen. Just click on the database you are using for your WordPress site.

choose a database.jpg

Then it will show you the list of tables in this database. You must click on the 'wp_options' table to open it.

Please note: : By default, WordPress database tables use wp_ as the prefix for table names. However, it is possible to see a different prefix if you or an administrator of your site changed the prefix of the WordPress database.

choose the option table wordpress.jpg

When opening the table, you need to scroll down and find the 'template' and 'stylesheet' rows. Then click on the Edit button.

links edit line table phpmyadmin.png

This will open the row editor where you need to change the value of the option_value field to whatever theme you want to use. This is usually the same as the name of the folder in the / wp-content / themes / folder.

set a value for the theme.png

After that click on the "Go" button below to save your changes. Now repeat the process for the stylesheet row.

Once you have saved your changes, you can go to your website to see the new theme in action.

We hope this article has helped you learn how to change the WordPress theme via phpMyAdmin.