Troubleshooting WordPress themes

When the current theme breaks or has a problem, it can make the entire site inaccessible with errors. This makes it hard to switch to a working theme because even the admin panel won't load.

There are two ways to change the database when you don't have the ability to log into your site:

  • Using the command line
  • Changing the theme in the database (using phpMyAdmin)

Using the command line

  1. Connect to your server via SSH and use the WordPress command line tool.
  2. Type the following to view a list of all available themes:
    [server]$ wp theme status
  3. Type the following to change your theme:
    [server]$ wp theme activate twentyfifteen
  4. If you don't have twentyfifteen, install and activate it in one command:
    [server]$ wp theme install twentyfifteen --activate

Changing the theme in the database

To switch to a different theme using the database:

  1. Log into phpMyAdmin.
  2. Click your database name on the left.
    03 Change wordpress site url phpmyadmin.fw.png
  3. Find the _options table in the left column (the table name has a prefix but ends with "_options")
    01 WordPress Troubleshooting.fw.png
  4. Go to the second page and look for the options with the names template and stylesheet.
  5. Click the pencil icon to the left of each.
    In the large text field, you can see the current theme name:
    02 WordPress Troubleshooting.fw.png
  6. Change this to any theme you wish your site to use.
  7. Click the Go button when finished to save your changes.

See also

Did this article answer your questions?

Article last updated .