Recently, one of our readers asked us if he could change his WordPress theme depuis la base de data. WordPress simplifie la gestion des thèmes du tableau de bord. Toutefois, si vous ne parvenez pas à accéder à votre tableau de bord WordPress, vous devrez trouver d’autres moyens pour modifier votre WordPress theme. In this tutorial, we will show you how to easily change your WordPress theme via 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.
Cependant, si vous n’avez pas de sauvegarde et que vous ne voulez pas revenir vers un thème par défaut, vous pouvez utiliser un thème WordPress personnalisé de votre base de data en utilisant 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 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.
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 WordPress hosting account. Next, scroll down to the Databases section and click on phpMyAdmin.
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.
Then it will show you the list of tables in this database. You must 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 prefix if you or an administrator of your site changed the prefix of the WordPress database.
When opening the table, you need to scroll down and find the 'template' and 'stylesheet' rows. Then click on the Edit button.
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.
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.