Don’t ask me how that happened. The title pretty much explains everything. I’m building a brand new site and occasionally I delete my global CSS (which is very long) for debugging purposes. I always back it up before doing so, but somehow didn’t this time and the last backup I made was many edits ago. Is there any way to restore the lost global CSS or revert it back?
Hello Sinan,
Thank you for the very detailed post information. Be advised that all the Theme Options Settings including the custom CSS will be saved in the database. If you have accidentally refresh the page, the custom CSS should still be present if you reload the page again assuming that you did not save your changes after you have deleted the CSS. If the custom CSS is already empty, the only way you can restore it is by using the backup feature of your hosting provider. You may need to contact the hosting provider for additional support asking them to revert your changes or restore your site from a few hours back up.
Kindly let us know how it goes.
Thanks for the quick and detailed answer. I did indeed save before accidentally refreshing the page and that is the root of the problem. I’ll contact my host now and see if there is any backed up version that I can revert to. Thanks.
EDIT: I filed a support ticket with my server provider just to be sure, but as of yet it seems as though they don’t have any sort of automatic backup mechanic. I definitely don’t have any manual ones either. Does this mean that all my CSS edits of the two last weeks are indeed gone forever?
Hello @SinanDira,
As I have mentioned, those global custom CSS was saved in the database. If the database has been changed and/or overwritten since you have saved your changes, that CSS is no longer in the database. The only hope is the server backup which most of the hosting provider does have every day or hourly. If the current hosting provider does not have that feature, we highly recommend that you find another that does because for now it might be just custom CSS and in the future, there could be a time something might happen and you need it to get your site back online.
Cheers.
Hello again. My host managed to find a complete backup from before the issue. What files do I need to replace to restore the Global CSS?
Hi @SinanDira,
Great to hear you’ve got a backup! Here’s what you’ll need to do from here. Regretfully we can’t assist with this but you might be able to get more help from your host or google around to find some ideas.
- You need to find the sql database file (likely included with the backup)
- It might be possible to just open that in a text editor and search for some of the keywords you remember being in your CSS
- Otherwise, you’ll need to import that database into a MySQL server and extract the custom CSS. It is in the
wp_optionstable and the option name isx_custom_styles.
Hopefully this helps!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.