Family Encyclopedia >> Electronics

How to change WordPress theme via phpMyAdmin

Recently, one of our readers asked us if they could change their WordPress theme from the database. WordPress makes it extremely easy to manage themes from the admin area. However, if you can't access the WordPress admin area, you'll need to find other ways to change your WordPress theme. In this article, we will show you how to easily change your WordPress theme through phpMyAdmin.

How to change WordPress theme via phpMyAdmin

Why and when do you need to use phpMyAdmin?

Normally, the easiest way to change the WordPress theme is to visit the Appearance » Themes Page in the WordPress admin area. However, sometimes a WordPress bug can make your website's admin area inaccessible.

In that case, the safest way to recover your website is to restore it from backup. Another way is to fix the WordPress error that is causing the problem. In troubleshooting, the easiest way to change themes is to backup your existing theme via FTP and then delete all theme folders from /wp-content/themes/ except the default theme. WordPress will automatically revert to the default theme.

Both of the above methods will give you access to the WordPress admin area and you will be able to change the theme.

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

That said, let's see how to change the WordPress theme through phpMyAdmin.

Change your WordPress theme through phpMyAdmin

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

You will need to connect 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.

How to change WordPress theme via phpMyAdmin

Note: Type the name of the theme folder you want to change to. You will need it in the next step.

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

After making sure that 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 control panel of your WordPress hosting account. Next, scroll down to the databases section and then click on phpMyAdmin.

How to change WordPress theme via phpMyAdmin

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

How to change WordPress theme via phpMyAdmin

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

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

How to change WordPress theme via phpMyAdmin

When you open the table, you need to scroll down and locate the 'template' and 'style sheet' rows. Next, click the Edit button next to the template row.

How to change WordPress theme via phpMyAdmin

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

How to change WordPress theme via phpMyAdmin

After that, click the 'Go' button below to save your changes. Now repeat the process for the style sheet row as well.

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

We hope this article helped you learn how to change WordPress theme through phpMyAdmin. You may also want to see our complete beginner's guide to WordPress database management using phpMyAdmin.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.