May 11, 2013

Fix WordPress Themes From Databases



A new version (3.5.1) of WordPress Core comes with two default themes, Twentyeleven and Twentytwelve themes, sometimes when we change it and activated a new themes the backend or frontend became a blank page, to fix this you can login from ftp or ssh to your WordPress installation and remove a new themes recenlty activated, so you can access back your website because with this way WordPress will use the default themes.

Another way to fix blank page error when you activated a new themes is via database, to do this way first you must login to mysql database, you can use phpmyadmin and select an active database name, or if you familiar with console you can do it via mysql command shell.

In your database select from wp_options table (this name depend on your prefix tables), exactly on option_name column, watch value on template, stlesheet and current_theme, use below sql syntax:

SELECT * FROM wp_options WHERE option_name = 'template' OR option_name = 'stylesheet'
 OR option_name = 'current_theme';

Watch result from query above especially value on option_value column, what is listed there is your wp themes which active now, now you have to change that things to 'default' or 'classic' so your WordPress can access back.

Below is sql syntax to change active themes to default or classic template:  

UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template';
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet'; 

UPDATE wp_options SET option_value = 'default' WHERE option_name = 'current_theme';

With two steps above your WP active themes use the default template back, now you can access your website to see if all things run normally.

If you have a problem with default themes, try to change it to another themes that you have in themes directory, just change option_value column with your themes name. maybe like this below:

UPDATE wp_options SET option_value = 'YOUR_THEMES' WHERE option_name = 'template';
UPDATE wp_options SET option_value = 'YOUR_THEMES' WHERE option_name = 'stylesheet'; 

UPDATE wp_options SET option_value = 'YOUR_THEMES' WHERE option_name = 'current_theme';

That's it and Thank You

1 comment:

  1. Good way of describing, and good post to obtain data concerning my presentation topic, which i am going to deliver in
    university.


    blogger templates

    ReplyDelete