WordPress theme reverts to default – solved?

I’ve been struggling with this for as long as I’ve had this site on WordPress (since January 2007). I think (hope) I’ve finally found the solution.

The problem: From time to time, for no apparent reason and based on no obvious trigger, the theme would revert to the default WordPress theme.

Strangely enough, when I checked the theme in WordPress Appearance settings, it would be set to the correct theme and say the files were in the right place, but the site would look like something else. I’d have to re-activate the correct theme to get the site to use the current theme. Unfortunately when I did, I lost all the custom settings in my Thesis theme and would have to start over.

I Googled for solutions a few times. Many sites talked about the issue. Most pointed to incorrect installation of the WP Mobile plug-in as the culprit. That wasn’t my problem. Most recommended a hack solution of copying the site’s theme into the default folder, so even when it reverted it would look correct. Sure, that worked. Except when I tried to change theme settings they wouldn’t take because the changes were happening in the wrong folder. I recently upgraded to Thesis 1.5 and now when the site reverted to the default theme which still had older Thesis files, the layout broke completely.

No way of troubleshooting with trial and error because I couldn’t replicate the problem consistently. Sometimes I’d go for weeks without it reverting to default. Sometimes it happened multiple times a day.

This morning, after loading the site and finding it blank (!!) and yet again resetting the theme and all its options, I Googled one last time before inevitably having to copy Thesis 1.5 into the Default folder.

How did I miss this page from 2007 with a solution I hadn’t tried before?

…And, sure enough, if you look at the code, it is designed so that if the theme directory is not found, it will set both the “template” and “stylesheet” to default. That is by design, and not a bug. So, the question is, what is calling up this site’s WordPress files from another location? If this site’s database was called from another location using a WordPress installation which did NOT have the same theme installed, it would obviously set me back to “default”.

Well, now I’m onto something, but unfortunately, on first glance, I don’t have anything installed on this server which would be calling the same database using different WordPress files. But, do I? Here is the “kick my own ass” moment. Yes, I did. I had had a WordPress installation on this site sitting in the “blog” sub-folder which I used for testing back in the day. Something on that site must have been spidered and somebody came upon it. The moment I went and called up http://www.webbyonline.com/blog/, my theme on this site reverted to “default”.

Eureka!! I’m kicking my own ass right now, too.

Way back in late 2006 when I was playing with the idea of switching to WordPress, I installed it to blog.momathome.com as a test domain. Just to play around before deciding if I was going to convert the main site. I meant to delete it once I was sure, but then I totally forgot it was there. Sure enough, I checked Google and the URL is in its index. Argh!!

I deleted all the files in the directory, except for an .htaccess file with one simple line:

redirect 301 / http://www.momathome.com

That should automatically redirect any visits to blog.momathome.com and tell Google that the change is permanent, eventually eliminating that URL from its index.

If there’s a better way of doing this, let me know but I think that should do it.


One response to “WordPress theme reverts to default – solved?”

  1. I’m glad you managed to solve that problem. That would have been so annoying. Fortunately for me I can save all my theme settings and if anything goes wrong I can restore it to the last file I had saved. I also use this feature to change the themes look depending on the occasion, so I can have an Easter, Mother’s Day or whatever theme.