Title: _wp_sidebars_changed
Published: April 25, 2014
Last modified: April 28, 2025

---

# _wp_sidebars_changed()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Handles sidebars config after theme change.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#source)󠁿

    ```php
    function _wp_sidebars_changed() {
    	global $sidebars_widgets;

    	if ( ! is_array( $sidebars_widgets ) ) {
    		$sidebars_widgets = wp_get_sidebars_widgets();
    	}

    	retrieve_widgets( true );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/widgets.php#L1292)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/widgets.php#L1292-L1300)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#related)󠁿

| Uses | Description | 
| [retrieve_widgets()](https://developer.wordpress.org/reference/functions/retrieve_widgets/)`wp-includes/widgets.php` |

Validates and remaps any “orphaned” widgets to wp_inactive_widgets sidebar, and saves the widget settings. This has to run at least on each theme change.

  | 
| [wp_get_sidebars_widgets()](https://developer.wordpress.org/reference/functions/wp_get_sidebars_widgets/)`wp-includes/widgets.php` |

Retrieves the full list of sidebars and their widget instance IDs.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_sidebars_changed/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_wp_sidebars_changed%2F)
before being able to contribute a note or feedback.