2

When making changes in the full site editor, where are the settings actually stored?

When searching for this I get a gazillion results saying the settings are stored in theme.json, but this can't be right. If I check the theme.json file right after making changes in the full site editor the changes are not reflected in theme.json. I have to export the theme in the full site editing first.

1 Answer 1

3

When you make modifications to templates the new HTML of the template is saved as a custom post type with the wp_template post type. This is then used instead of the version stored in the theme directory. The same is true template parts, except the post type for those is wp_template_part.

When you modify global styles the styles and settings properties of theme.json are copied to to the database, this time as a post with the wp_global_styles post type, with your changes applied to this copy.

3
  • Thanks. It was that last part about global styles I was concerned about. Found it when searching for wp_global_styles in the phpMyAdmin. Kind of weird that the changes are written to the DB and not the theme.json file. Why is that?
    – Arete
    Mar 25, 2023 at 11:27
  • 1
    Reading and writing from files is slower and theme files are all overwritten whenever there’s a theme update. It would also make it impossible to reset to defaults. Mar 26, 2023 at 4:23
  • Thank you very much @JacobPeattie for detailed answer.. one more thing for future WP google-er like me.. if you use customizer.php to style (easier css) then it's saved in custom_css post type.. good thing it's both outputed on front Apr 15, 2023 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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