WordPress makes managing themes very simple. However, if you cannot access your WordPress management area, then you will need to find other ways to change your WordPress theme. This article will show how to easily change your WordPress theme through phpMyAdmin.
Why and when is phpMyAdmin needed to be used?
Generally, the easiest way to change a WordPress theme is to visit the Appearance »Theme page in the WordPress management area. However, sometimes a WordPress error may make the website management area inaccessible. In this case, the safest way to restore your website is to restore it from a backup. Another way is to solve the WordPress error that caused the problem. When troubleshooting, the easiest way to switch themes is to back up the existing themes via FTP, and then remove all theme folders except the default theme from / wp-content / themes /. WordPress will automatically revert to the default theme.
Both of the above methods allow the user to access the WordPress admin area and then can change the theme. However, if there is no backup, and the user does not want to revert to the default theme, use phpMyAdmin to change from the database to a custom theme. Having said that, let’s take a look at how to change the WordPress theme through phpMyAdmin.
Change WordPress theme through phpMyAdmin
This method allows the user to tell WordPress which theme to use by changing the information in the database. To use this method, the theme to switch to must already be installed on the website. Use FTP client to connect to the website and go to the / wp-content / themes / folder. There all the themes currently installed on the website are seen.
Note: Note the name of the theme folder to switch. It is needed in the next step.
If the theme to switch is not installed on the website, manually install the theme via FTP. After confirming that the theme is installed on the website, now continue and change the theme through phpMyAdmin.
First, go to the cPanel dashboard of the hosting account. Next, scroll down to the database section and click phpMyAdmin.
Once in phpMyAdmin, a list of databases is displayed on the left side of the screen. Just click on the database used for the WordPress website.
Next, it will show the list of tables in this database. Click on the ‘wp_options’ table to open it. Note: By default, WordPress database tables use wp_ as the table name prefix. However, if you or the administrator of your website changes the database prefix, you may see a different database prefix.
After opening the table, scroll down and find the ‘Template’ and ‘Style Sheet’ rows. Next, click the edit button next to the template row.
This will open the line editor and change the value of the option_value field to the theme to use. It is usually the same as the folder name in the / wp-content / themes/folder.
After that, click the “Go” button below to save changes. Now, repeat the process of style sheet rows. After saving the changes, visit the website to see the new themes being implemented.