WordPress Theme Resetting Problem Solved

wordpresslogo.jpgOver the past few days, WordPress (the blogging software I use) has been randomly reverting back to the default theme. This unfortunately loses the entire look and feel of the Pothole. I apologize to those of you who have unfortunately had to endure this, but I have solved the problem. If you are one of the many bloggers that also experiences this problem, keep reading.

Like so many of you, I was pulling my hair out trying to figure out how my blog could keep automatically reverting to the default WordPress theme without my involvement (or anything that I could easily track.)

So I started digging deeper. I looked at my binary MySQL logs and found several entries like this:

#061115 17:51:48 server id 1 end_log_pos 738507316 Query thread_id=572311 exec_time=0 error_code=0
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template';

#061115 17:51:48 server id 1 end_log_pos 738507464 Query thread_id=572311 exec_time=0 error_code=0
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet';

From these logs, I could see the timestamp that the change happened. So I cross-referenced over into the Apache web server logs and found that the only things happening at that time were just regular page views of my blog articles – nothing fancy. I even checked crontab, to make sure that one of my many database manipulating cron jobs wasn’t futzing something up. Nothing doing.

Then I realized what was happening. I noticed that all of those normal blog pageviews were coming from mobile devices. From user agents such as:

Then I realized that I had recently installed the WP-mobile plugin written by Alex King (although I hadn’t yet had the chance to test it out on my Treo using Blazer.) So, I whipped out my phone, hit scottburkett.com with my phone’s browser, and voila, the theme was switched to the default theme. It turns out that I had not properly followed the instructions provided by Alex in the plugin archive. Instead of following the instructions, and copying the files into the places he specified, I just unzipped them into the plugins directory and activated it. That was the whole problem – I needed to copy his “wp-mobile” theme over into the wp-content/themes directory. WordPress was trying to find it, and couldn’t, so it reverted automatically back to the default theme.

I have tested this thoroughly, and I am convinced that this was the problem. No, I know this was the problem. Great plugin, BTW, Alex. Good work.

If you are having this problem, but you are not using the aforementioned plugin, my guess is that your problem is caused by something similar. I hope this helps some people!

Cheers.

Scott Burkett - Peace Out!

18 Comments

  1. Scott, you rock, saved me at least an hour of time, thanks and love your comment setup and buttons.

  2. Chicken and egg problem. :)

    I should probably put this in the FAQ section of the README… but if you don’t read the README anyway, you aren’t going to see the FAQ.

  3. ROFL, Alex. You of all people should know that READMEs are for wimps! :D

    Great job on that plugin, BTW …

    Cheers.
    Scott

  4. Thanks man! Thought my site was taken over by some joker… ;)

    This just saved me a lot of password resetting!

  5. Roger Kondrat · April 1, 2007 at 6:16 am

    Hi Scott

    Thanks a million. I made that change but I don’t think that was my main problem anyway so its just good to know that instead of 2 problems with re-setting I have narrowed it to 1. :)

    Apparently there are many people in the WP forum having this problem and I doubt its Alexs plugin for all of them.

    Hey any idea how I can check my blog functions on a mobile device using my FF2.0? Maybe there is a plugin or something. Just thought I would ask.

    Cheers
    Roger
    PS I agree with David this is a nice commentting setup. I have always felt that if you have a nice commenting setup readers are more likely to comment and possibly more often.

  6. Hi there, Roger. I would imagine the problem you are having is very similar to what is described here with the mobile plugin.

    What I would recommend doing is disabling your pluins, and start enabling them one at a time. In between, ping your web site with FF2.0, Blazer, or some other mobile browser. Then reload your site using a desktop browser. When your theme has reset, you’ve found the culprit.

    Cheers.
    Scott

  7. Thank you very much, i was getting crazy with this “random” problem

  8. Man, this “bug” had been the main reason for me to stop blogging over the last month-and-a-half!

    After a cleanup I deleted the WP-mobile folder from my theme’s folder (somehow my wife managed to throw my mobile phone in the washing machine, therefore I have to deal with an old Nokia 3310 now and decided to delete the mobile function of my pages as I thought I was the only one ever to view my site on a mobile phone), but left the plugin activated.

    Drove me mad!
    Cheers!
    I can go sleep now!

    btw: still love the LUSH theme you have…used to use it myself…

  9. Thanks for sharing this! I was already pulling my hair out because of this problem :) Now I know how to fix it!

  10. Thank you very much. I was pulling the little hair I have out trying to solve this one. A search on WP Forums led me to this solution. It would have taken me forever to figure it out and teaches me a lesson; always read instructions!!
    Thank again!

  11. You’ve described my problem exactly. I corrected my installation of Alex King’s WP Mobile plugin, and I’ve crossed my fingers hoping that will fix my theme switching problem. Thanks for the helpful post.

  12. This bug is still going strong (as of WP 2.3) when the WP Mobile plug-in is not present. Seems strange that after almost two years no one at WP.com/mu/.org has been able to figure this out.

  13. My blog is getting this problem as well but the mobile plugin was never install (Wasn’t aware that there is such a plugin).
    I had disable all the plugin except akismet. Very doubtful that Akismet is the problem … where else should I look?

  14. 59ideas – even if you haven’t installed the mobile plugin, my guess is that it could be caused by something similar (a plugin trying to find a certain theme, and can’t, so it defaults to the stock one). My debugging approach outlined a few comments up from this one will probably serve you well. You’re just gonna have to narrow it down.

    Cheers.
    Scott

  15. You saved me! Thanks! :)

  16. Thanks very much for this post. You saved me from a lot of head scratching!

  17. Thanks for this fix! I knew that it was caused by mobile devices, but wasn’t sure what was wrong with it. Now all is right with the world! Cheers!

  18. Pingback: WordPress Theme Reset To Default at hwa2u.com

Leave a Comment

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