Change the active theme in a WordPress site via the database

Change the active theme in a WordPress site via the database

To change the active theme in a WordPress site via the database, follow these steps:

  1. Log in to your hosting control panel (e.g., cPanel, Plesk, etc.), and navigate to the database management tool, such as phpMyAdmin.

  2. 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.

  3. 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.

  4. Locate two rows with the option_name column set to template and stylesheet. These rows determine the active theme for your site.

  5. 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 the wp-content/themes directory).

  6. 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.