To change the active theme in a WordPress site via the database, follow these steps:
-
Log in to your hosting control panel (e.g., cPanel, Plesk, etc.), and navigate to the database management tool, such as phpMyAdmin.
-
Locate and select your WordPress database from the list of available databases. If you’re not sure about the database name, you can find it in the
wp-config.php
file of your WordPress installation. -
Inside the database, search for the table named
wp_options
. Note that the table prefix (wp_
in this case) might be different if you’ve set a custom table prefix during the installation of WordPress. -
Locate two rows with the
option_name
column set totemplate
andstylesheet
. These rows determine the active theme for your site. -
To change the active theme, edit the
option_value
column of both rows. Replace the existing value with the new theme’s folder name (the theme’s folder name must exactly match the folder name in thewp-content/themes
directory). -
Save the changes by clicking the “Go” button or the equivalent button in your database management tool.
After making the changes, the new theme should be active on your WordPress site. Remember to clear your site and browser cache, if any, to see the changes.