0

A WordPress site that I have written a few CSS custom styles for has lost its custom styles. I previously wrote the custom CSS in the Appearance > Edit CSS section of the admin dashboard. But now that menu item is gone from the Appearance menu. And the site no longer has those customizations to its styles.

This happened after the site owner “rebooted the site after his hosting provider shut it down for some scripting problem”. I notice that the site has also been updated to the latest version of WordPress, 3.8.1 up from 3.6.

The closest option to Appearance > Edit CSS I can find is is Appearance > Editor, which also lets you edit CSS, but only the whole CSS of the theme. I don’t want to put my CSS there, because then it might be overwritten if the theme is ever changed.

I also don’t want to use Appearance > Editor because I don’t want to have to rewrite my previous CSS from scratch. – I want the version that I already wrote. I read that my custom CSS might still be available in wp_options in the database, but I don’t have access to the site database, as far as I know – I just have an administrator account I can access the dashboard with.

1
  • Did you have a menu specifically labeled "Edit CSS" ?
    – s_ha_dum
    Commented Mar 23, 2014 at 15:02

2 Answers 2

3

In short: make sure that the Jetpack plugin is installed and enabled, and also that the Jetpack Lite plugin is not enabled.

I found out that Edit CSS is provided not by WordPress itself but by the plugin Jetpack. Jetpack was still installed; I had a Jetpack menu right below Dashboard. But when I opened it, I saw only two items, “WordPress.com Stats” and “WP.me Shortlinks”, neither of which have to do with CSS.

When I went to Plugins > Installed Plugins in the dashboard, I saw that the “Jetpack by WordPress.com” plugin was enabled. But right below it was “Jetpack Lite”, which turned out to be the culprit.

The purpose of Jetpack Lite is to “[Disable] all Jetpack modules except for Stats and WP.me Shortlinks modules”, for the sake of simplicity and saving memory. This means that it disables all other features of Jetpack, including the Edit CSS functionality. After I clicked Deactivate under Jetpack Lite in plugins, the Edit CSS menu reappeared and the site styles returned.

See also WordPress › Support » How to restore Edit CSS if Jetpack plugin was deleted?. It explains that CSS customizations in Edit CSS are saved separately from the plugin, in the wp_options table of the database, and that re-enabling the plugin will load the already-saved styles.

1

It may be time to learn how to use Child Themes. Takes less than 15 minutes to learn, saves huge amounts of time. It could be as simple as creating a style.css and giving it the proper the title info at the top of the file. See https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme

Using a child theme is like laying magic tissue paper over your normal theme. All customization goes into the child theme folder/directory. You don't have to touch a thing anywhere else.

With a Child Theme:

  • You don't have to sweat your customer admins accepting upgrades for anything and overwriting your work. When the parent theme is upgraded your customized work is safe.

  • You always know what work is yours and what work is the from the theme developers.

  • Its easy to turn on and turn off a child theme (one mouse click) If you find an error you can easily troubleshoot if it was something you did, or the error came from the the original theme developer.

  • Start out with CSS stuff, as you get more comfortable move on to php functions, and javascript.. All of your customization is stored in a single directory.

2
  • Thanks for the tip. The Edit CSS component of the Jetpack plugin already provides the first two features you listed, and I don’t have many styles, so I think it’s enough for now. But if the CSS gets any more complicated, I’ll try switching to a child theme. Commented Mar 23, 2014 at 6:33
  • I realize the advice is akin to "locking the barn after the horse is gone", but in the future, the child theme will save you tons of time. The other thing is, all of your work is displayed in easy to manage file(s) and not stuck on a database somewhere.
    – zipzit
    Commented Mar 23, 2014 at 6:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.