How To Change WordPress Theme When You Can’t Login!

Got the white screen from your WordPress page?

Getting php errors and not able to log in?

Spent hours (that you don’t have) debugging those errors and getting nowhere?

Then read on…

I had an unknown error in my php code that I just couldn’t debug – something to do with an unexpected ‘<‘ in my custom-image.php file.

I spent an hour trying to debug the code, then decided it was probably an error in the functions file from which it was being called.

I think it’s a bug in the new twentytwelve WP theme when adding custom header files.

Anyway, I ended up switching theme using this method and I’m back online!

If your site gets broken and you can’t access the wp-admin page, there are a number of things you can do. Going to cpanel > file manager > wp-content and renaming the plugins folder can sometimes do the trick.

You can also rename the offending theme and WordPress should revert to the default them. However, if none of these work, you may need to make changes to the site’s database directly. If it comes to this, don’t worry, it’s pretty simple. Just follow the below instructions and you should be back in business.

Step 1:

From the blog url, go to www.myblog.com/cpanel, log in and find the phpMyAdmin link. It should be located under the Databases heading.

Where to find phpmyadmin

Step 2:

Select the WP db which stores your site’s data – hopefully you named this something useful when you set up your site, so it should be easy to work out which one you’re looking for

Step 4:

Click on the table named YOURPREFIX_options. If you didn’t change the table prefix when installing, the default is wp_options.

Change WordPress theme through PHPMyAdmin

Step 4:

Select page 2 from the tables footer:

 

Page2mphpadmin3

 

Step 5:

Now find “template” and “stylesheet” fields and click on the edit icon. You can change then change them from the current theme to any other you have installed.

Change WP Theme and Stylesheet

Then Robert should indeed be your mother’s brother….

 

Any probs, please leave a comment.

 

TC