Title: WP_Theme_JSON_Schema::unset_setting_by_path
Published: February 3, 2022
Last modified: May 20, 2026

---

# WP_Theme_JSON_Schema::unset_setting_by_path( array $settings, array $path )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?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.

Removes a property from within the provided settings by its path.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/unset_setting_by_path/?output_format=md#parameters)󠁿

 `$settings`arrayrequired

Reference to the current settings array.

`$path`arrayrequired

Path to the property to be removed.

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

    ```php
    private static function unset_setting_by_path( &$settings, $path ) {
    	$tmp_settings = &$settings;
    	$last_key     = array_pop( $path );
    	foreach ( $path as $key ) {
    		$tmp_settings = &$tmp_settings[ $key ];
    	}

    	unset( $tmp_settings[ $last_key ] );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json-schema.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-theme-json-schema.php#L220)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-theme-json-schema.php#L220-L228)

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

| Used by | Description | 
| [WP_Theme_JSON_Schema::rename_settings()](https://developer.wordpress.org/reference/classes/wp_theme_json_schema/rename_settings/)`wp-includes/class-wp-theme-json-schema.php` |

Processes a settings array, renaming or moving properties.

  |

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

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

## User Contributed Notes

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