admin管理员组

文章数量:1406920

I've been using a block theme for some time but recently (not sure when), all the additional CSS I had stored disappeared. I'm not sure how to retrieve that data and I'm hoping someone here can point me in the right direction. I'm afraid that whatever deleted that option in the left-hand menu of the admin panel also deleted the additional css I had set for the site.

Is there a resource on the internet (such as the Wayback Machine) that might have preserved that CSS data? I wrote some of that years ago and I cannot remember how I laid out a few things. I've restored some of the lost data from a very old version of my CSS but that was before I made some more recent changes.

I've been using a block theme for some time but recently (not sure when), all the additional CSS I had stored disappeared. I'm not sure how to retrieve that data and I'm hoping someone here can point me in the right direction. I'm afraid that whatever deleted that option in the left-hand menu of the admin panel also deleted the additional css I had set for the site.

Is there a resource on the internet (such as the Wayback Machine) that might have preserved that CSS data? I wrote some of that years ago and I cannot remember how I laid out a few things. I've restored some of the lost data from a very old version of my CSS but that was before I made some more recent changes.

Share Improve this question edited Mar 24 at 0:27 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Mar 23 at 22:47 OscarGuyOscarGuy 351 silver badge9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

In classic themes, the “Additional CSS” from the Customizer is stored in the database under: wp_options → theme_mods_{your-theme-name} or wp_global_styles, sometimes in a key called custom_css.

Block themes often hide or completely remove the Customizer from the menu, which can make it appear as though your CSS is missing — even though it may still exist in the database.

To check, you can run:

SELECT * FROM wp_posts WHERE post_type = 'custom_css';

or

SELECT * FROM wp_posts WHERE post_type = 'wp_global_styles';

In some cases, the css is stored by postmeta:

SELECT * FROM wp_postmeta WHERE meta_key LIKE '%css%';

Please note: if your WordPress installation uses a different table prefix than wp_, you'll need to update the table names accordingly. For example:

  • wp_posts to khuw7i_posts
  • wp_postmeta to khuw7i_postmeta

Good luck!

本文标签: Custom CSS Has Disappeared