The WordPress Full Site Editor provides a powerful way to customize your site’s appearance and functionality. However, understanding where these changes are stored can be a bit confusing. In this guide, we’ll break down the storage of modifications made in the Full Site Editor, addressing concerns raised in a recent discussion.
Where Are the Settings Stored?
The original question in the discussion raised concerns about the storage location of changes made in the Full Site Editor. Contrary to common belief, the settings are not directly stored in the theme.json
file. Let’s clarify how modifications are stored based on different types of changes.
Template Modifications
When you make changes to templates in the Full Site Editor, the new HTML of the template is saved as a custom post type with the name wp_template
. This post type is then used instead of the version stored in the theme directory. Similarly, modifications to template parts are stored as a custom post type with the name wp_template_part
.
Global Styles Modifications
For changes to global styles, specifically the styles
and settings
properties in theme.json
, they are copied to the database. This information is stored as a post with the wp_global_styles
post type. Your modifications are applied to this copy, ensuring that your global styles persist across the site.
A user in the discussion also pointed out that they found these changes by searching for wp_global_styles
in phpMyAdmin, a popular database management tool.
The Reason for Database Storage
One user in the discussion asked why global styles changes are written to the database and not directly to the theme.json
file. There are a few reasons for this approach:
- Performance: Reading and writing from files can be slower compared to database operations. Storing changes in the database allows for quicker retrieval and application of styles.
- Theme Updates: Theme files are often overwritten during updates. Storing modifications in the database ensures that your changes persist even after a theme update.
- Resetting to Defaults: Storing in the database makes it possible to reset styles to defaults if needed, providing flexibility for site administrators.
Additional Insight from Comments
The discussion’s comments provided some additional helpful information:
- If you use
customizer.php
for styling, it’s saved in thecustom_css
post type. - Storing modifications in the database is advantageous for speed and the ability to reset to defaults, especially considering the potential impact of theme updates.
Understanding where and how modifications are stored in WordPress can empower users to make informed decisions when customizing their sites through the Full Site Editor.