WordPress Site Editor Changes Not Saving or Not Showing (Block Themes)
You edited a template, a header or theme.json and nothing changed. Learn how block themes layer database overrides over theme files, and how to see which one wins.
Your sidebar is empty, the header has no menu and the logo is gone. Nothing was deleted. Learn where each setting lives per theme and how to bring it back.
You activated a new theme (or a child theme) and the site suddenly looks bare. The sidebar is empty, the header shows a list of every page instead of your menu, the logo and header image are gone, your brand colors are back to the defaults, and the CSS you added in the Customizer has stopped working. Switching back to the old theme often brings some of it back, which makes it feel random.
It is not random, and almost nothing is deleted. WordPress stores some settings for the whole site and others separately for each theme. Menus, widgets and posts are site-wide, but which menu goes in which location, which widget sits in which sidebar, the logo, Customizer choices and Additional CSS are all tied to the theme that was active when you set them. This guide maps exactly where each one lives and how to move it to the new theme.
Each theme gets its own row in the wp_options table called theme_mods_THEMESLUG, where THEMESLUG is the theme’s folder name. A child theme has its own folder, so it gets its own, empty row the first time you activate it. When you switch, WordPress makes a best guess at carrying over menu locations and widget areas, but only where the new theme uses similar names.
| What you lost | Where it is stored | Per theme? |
|---|---|---|
| Menus and menu items | nav_menu terms and nav_menu_item posts |
No, they are safe |
| Which menu is in which location | nav_menu_locations inside theme_mods_THEMESLUG |
Yes |
| Widget settings (text, images, blocks) | Options named widget_ID_BASE, for example widget_block, widget_text |
No |
| Which widget sits in which sidebar | The sidebars_widgets option, plus a snapshot inside the old theme’s theme_mods |
Layout is per theme |
| Custom logo, header image, background, colors, theme Customizer options | theme_mods_THEMESLUG (some themes use their own option instead) |
Yes |
| Site title, tagline, site icon | blogname, blogdescription, site_icon options |
No |
| Additional CSS (Customizer) | A post of type custom_css named after the theme slug |
Yes |
| Block theme styles, templates, Navigation menus | wp_global_styles, wp_template, wp_template_part and wp_navigation posts |
Styles and templates yes, Navigation menus no |
When you switch away from a theme, WordPress also saves that theme’s widget layout into its own theme_mods (under a sidebars_widgets key with a timestamp) and remembers its menu locations. That snapshot is why switching back restores most things.
For menus, WordPress (since 4.9) maps old locations to new ones when their names contain words from the same group: primary, menu-1, main, header, navigation and top form one group, secondary, menu-2, footer, subsidiary and bottom another, and social a third. For widgets, it does the same with sidebar IDs, grouping names like sidebar, primary, main and right, then footer and bottom, then header and top. Anything it cannot match goes to Inactive Widgets or is left unassigned. Widgets that only existed because the old theme registered them are hidden, but their settings stay in the database.
You need an administrator login, and for the faster fixes, SSH access with WP-CLI. Take a database backup before importing or overwriting any option, because these commands replace data rather than merging it.
How to run commands in this guide:
wp-config.php). Your host may name the tool wp or wp-cli.Most importantly: do not delete the old theme yet. Deleting the folder does not delete its settings rows, but you lose the easy route of switching back to look at or restore them.
wp theme list --fields=name,status,version
wp option list --search="theme_mods_*" --fields=option_name,autoload
Run these over SSH in the site folder.
wp theme list shows each theme’s folder name (the name column) and which one is active. A child theme shows its own name; its parent shows parent in the status column.--search filters option names with a wildcard. Each result is one theme’s saved settings.Good output lists a theme_mods_ row for your old theme. That row is where your logo, menu locations and Customizer choices are waiting. If there is no row for the old theme, its settings were stored elsewhere (some themes use their own option name) or the old theme was never activated on this database, for example after a partial migration.
To look inside one:
wp option get theme_mods_OLDTHEME --format=json
OLDTHEME is the old theme’s folder name from the list above. --format=json prints the stored array as JSON so you can read it. Look for keys like nav_menu_locations (location name to menu ID), custom_logo (an attachment ID), header_image, custom_css_post_id and sidebars_widgets. An almost empty result such as {"custom_css_post_id":-1} means that theme had no real customizations saved.
Your menus still exist; they are just not attached to the new theme’s locations. In the dashboard, go to Appearance, Menus, open the Manage Locations tab, pick a menu for each location and click Save Changes. If the header shows every page in a plain list, that is the theme’s fallback when no menu is assigned.
wp menu location list
wp menu list --fields=term_id,name,slug,locations
wp menu location assign MENU_SLUG LOCATION_SLUG
Run these over SSH in the site folder.
LOCATION_SLUG is a value from its location column, such as primary or footer.MENU_SLUG comes from its slug column. An empty locations column means the menu is not shown anywhere.Good output after assigning is “Success: Assigned location LOCATION_SLUG to menu MENU_SLUG.” If you see “Invalid location”, the new theme does not register that location, so check the slug in the first list.
If the new theme is a block theme, there is no Menus screen. Menus are Navigation blocks in the Site Editor, covered in Step 6.
Go to Appearance, Widgets. Since WordPress 5.8, this screen uses the block-based widget editor. Scroll to the bottom for an Inactive widgets area. Widgets that WordPress could not map are kept there with all their content. Drag or move each one into the new theme’s sidebar or footer area and click Update.
If your site uses the Classic Widgets plugin, the old screen appears instead: inactive widgets sit in a box at the bottom left, and you drag them into the widget areas on the right. Both editors read and write the same options, so switching between them does not lose anything. Block widgets are stored in the widget_block option; classic widgets each have their own option.
wp sidebar list --fields=id,name
wp widget list wp_inactive_widgets --fields=name,id,position
wp widget move WIDGET_ID --sidebar-id=SIDEBAR_ID
Run these over SSH in the site folder.
wp sidebar list shows the widget areas the active theme registers. SIDEBAR_ID comes from its id column, such as sidebar-1.wp widget list wp_inactive_widgets lists the parked widgets. WIDGET_ID comes from its id column and looks like block-7 or text-3.--sidebar-id sets the destination. Add --position=POSITION_NUMBER to choose where it lands, with 1 as the top.Good output is “Success: Widget moved.” An empty inactive list means the widgets were mapped into some other area, so list each sidebar from wp sidebar list to find them.
Some themes register their own widgets (a theme “About me” or “Recent posts with thumbnails” widget). When the theme is not active, those widget types do not exist, so WordPress hides the instances. Their settings remain in the database under widget_ID_BASE options, but you cannot use them in the new theme. Recreate them with core blocks or a plugin. Switch back to the old theme briefly if you need to copy their text.
These live in the old theme’s theme_mods row, so they do not follow you. The quickest fix is usually to set them again in Appearance, Customize: the logo is under Site Identity, and colors, header and layout options are wherever the new theme puts them. Your old logo image is still in the Media Library.
For many settings, or when moving from a parent theme to its child theme, copy the row instead. This is safe only when both themes use the same setting names, which is true for a parent and its child and usually false for two unrelated themes.
wp option get theme_mods_OLDTHEME --format=json > theme-mods-OLDTHEME.json
wp option get theme_mods_NEWTHEME --format=json > theme-mods-NEWTHEME-before.json
wp option update theme_mods_NEWTHEME --format=json < theme-mods-OLDTHEME.json
Run these over SSH in the site folder.
OLDTHEME and NEWTHEME are the folder names from Step 1. For a child theme, OLDTHEME is the parent folder and NEWTHEME is the child folder.<) and replaces the new theme’s row with it.--format=json tells WP-CLI to decode the JSON back into a PHP array instead of saving it as a plain string.Good output is “Success: Updated ‘theme_mods_NEWTHEME’ option.” Reload the site and check the logo and menus. If the output says “Value passed for ‘theme_mods_NEWTHEME’ option is unchanged”, the rows were already identical. To undo, run the third command again with the -before file.
After copying, note the custom_css_post_id key: it points at the old theme’s Additional CSS post, so the new theme now shows that CSS, and editing it changes the old theme’s copy too. For a parent and child that is usually what you want. For a separate copy, activate the new theme, run wp theme mod remove custom_css_post_id, and paste the CSS in again as in Step 5. Some themes and page builder theme kits keep their settings in their own option (often named after the theme) rather than theme_mods. Those survive a switch untouched, but the new theme will not read them. The theme’s own export and import tool, or a plugin such as Customizer Export/Import, is the right route for those.
CSS added under Appearance, Customize, Additional CSS is saved as a post of type custom_css whose slug is the theme’s folder name. A new theme starts with no CSS. Your old CSS is still there:
wp post list --post_type=custom_css --post_status=any --fields=ID,post_name,post_modified
wp post get CSS_POST_ID --field=post_content > additional-css-OLDTHEME.css
Run these over SSH in the site folder.
post_name column is the theme slug, so you can tell which belongs to which theme.CSS_POST_ID is the ID of the old theme’s row. --field=post_content prints only the CSS, and > saves it to a file you can open.Paste the CSS into the new theme’s Additional CSS box and save. Review it first: selectors written for the old theme’s markup will often match nothing in the new theme, and some rules (for example hiding the old theme’s elements) may now hide the wrong things.
No row for the old theme means the CSS was elsewhere: in a child theme’s style.css, a page builder’s global CSS setting, or a “custom CSS” plugin. In a block theme, extra CSS is added under Styles in the Site Editor instead, and is stored with the global styles rather than in a custom_css post.
Moving from a classic theme to a block theme changes more than settings. Block themes build the header, footer and sidebars from templates and template parts, so there are no widget areas, no Menus screen and often no Customizer.
wp_navigation post from your old menu. The classic menu stays where it was.wp_classic_sidebars, so the old widget areas can still be found. Recent versions of the Template Part block offer an import widget area option in its Advanced settings to turn one into a template part. Otherwise, rebuild the content with blocks.Going from a block theme back to a classic theme, Navigation block menus do not become classic menus automatically. Rebuild the menu under Appearance, Menus, using the Navigation block’s link list as a reference.
If the new theme was a mistake, reactivate the old one. WordPress restores the old widget layout from the snapshot it saved, maps menu locations back, and the old theme_mods row, logo and Additional CSS take effect again because they never left. Then check:
For a redesign on a busy site, treat the switch like a migration and snapshot everything theme-related first:
wp option get theme_mods_OLDTHEME --format=json > snapshot-theme-mods.json
wp option get sidebars_widgets --format=json > snapshot-sidebars-widgets.json
wp option list --search="widget_*" --fields=option_name --format=csv > snapshot-widget-options.csv
wp menu location list --format=csv > snapshot-menu-locations.csv
wp post list --post_type=custom_css,wp_global_styles,wp_template,wp_template_part,wp_navigation --post_status=any --fields=ID,post_type,post_name,post_modified --format=csv > snapshot-theme-posts.csv
Run these over SSH in the site folder before you switch.
OLDTHEME is the current theme’s folder name.widget_ option so you know which widget types were in use. Use wp option get OPTION_NAME --format=json on any you want in full.Good output is a set of files with data in them. The error “Could not get ‘theme_mods_OLDTHEME’ option. Does it exist?” means the slug was wrong.
Then use Live Preview (Appearance, Themes, hover over the theme) for a classic theme, or a staging copy for anything bigger. Live Preview lets you assign menu locations and widgets in the Customizer before activation, and those choices are saved with the activation, which is the cleanest way to switch on a live site. With the snapshot files, you can always compare old and new menu location IDs or widget positions side by side. Keep a written map of old location to new location and old sidebar to new sidebar: it turns a confusing afternoon into a ten minute checklist.
One more trap for designers: many themes write layout choices (sidebar position, container width, header layout) into theme_mods too. Copying a whole theme_mods row between two unrelated themes can bring across keys the new theme interprets differently. Between unrelated themes, copy individual values by hand, or use wp theme mod set KEY VALUE for single keys, where KEY is the setting name from the JSON and VALUE is its value.
Most of this you can fix yourself. Open a ticket if you need a database backup from before the switch restored to a staging copy so you can pull settings out of it, if you do not have SSH access and need the commands above run, or if the switch coincided with errors rather than just missing settings. Include:
theme_mods_OLDTHEME and the custom_css post) pulled from a backup.If the site looks broken in other ways, our diagnostic tools can help you narrow it down.
Did this fix it?
Still stuck? Start again from what you can see in the Emergency Room.
Still stuck?
Print a free one-page checklist to keep, or open the Emergency Room if the symptom does not match.
Get the free checklistsKeep reading
Search the field manual
Or jump straight to a symptom
Press / to search from any page, Esc to close