How to Change your WordPress theme from the database.

  • Step 1 – Open your database in phpMyAdmin
  • Step 2 – Click wp_options
  • Step 3 – Locate the theme in the table
  • Step 4 – Replace the theme
  • Step 5 – You’re done!

Normally you manage your WordPress themes from the dashboard in wp-admin. In some cases, this isn’t possible, for example when you get a white screen after an update and are unable to login.

You can solve this by changing the active theme to a default theme from the database. After this you can log in again to wp-admin and manage your site from there.

A default theme is a theme that was active when you first installed WordPress, for example, twentytwenty.

Step 1 – Open your database in phpMyAdmin

PhpMyAdmin is an open-source tool where you can administer your MariaDB database(s). It is pre-installed with your web hosting subscription. In phpMyAdmin you can, import, export, optimize, or drop tables.

If your website is using a database, this is where all the data of your site is stored. For example, WordPress stores all your posts, comments and articles in a database

Step 2 – Click wp_options

In the menu to your left, click wp_options to open the options table

Step 3 – Locate the theme in the table

Find the rows called template and stylesheet. They are usually located on page 2 in the options table.

Step 4 – Replace the theme

  1. Click the field option_value for template
  2. Replace the current theme with a default theme, like twentysixteen.
  3. Press enter to save.
  4. Do the same for stylesheet.

Step 5 – You’re done!

The theme is now changed and your website is accessible again and you can log in to your WordPress administration.

Leave a Comment

Your email address will not be published. Required fields are marked *