Title: WP_View_Config_Data::remove_properties
Published: August 20, 2026

---

# WP_View_Config_Data::remove_properties( mixed $current, mixed $spec ): mixed

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?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 the properties a spec names from the current value.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#description)󠁿

The mirror of merge_properties(), applied at every nesting level: a list in $spec
names entries to delete from $current — associative keys are unset, and list members
are matched by identity (list_item_identity) and dropped — while an associative 
$spec recurses into each named entry to prune from within it. A name absent from
$current is ignored, and a list is renumbered after members are removed so it keeps
sequential keys.

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

 `$current`mixedrequired

The current value.

`$spec`mixedrequired

The names to remove from it.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/?output_format=md#return)󠁿

 mixed The pruned value.

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

    ```php
    private function remove_properties( $current, $spec ) {
    	if ( ! is_array( $current ) || ! is_array( $spec ) ) {
    		return $current;
    	}

    	$current_is_list = array_is_list( $current );

    	if ( array_is_list( $spec ) ) {
    		// Each entry names something to delete from the current value.
    		foreach ( $spec as $name ) {
    			if ( $current_is_list ) {
    				$current = $this->remove_list_member( $current, $name );
    			} else {
    				unset( $current[ $name ] );
    			}
    		}
    	} else {
    		// Each key names an entry to recurse into and prune from within.
    		foreach ( $spec as $name => $subspec ) {
    			if ( $current_is_list ) {
    				foreach ( $current as $index => $member ) {
    					if ( $this->list_item_identity( $member ) === (string) $name ) {
    						$current[ $index ] = $this->remove_properties( $member, $subspec );
    						break;
    					}
    				}
    			} elseif ( array_key_exists( $name, $current ) ) {
    				$current[ $name ] = $this->remove_properties( $current[ $name ], $subspec );
    			}
    		}
    	}

    	// Renumber so a list from which a member was removed keeps sequential keys.
    	return $current_is_list ? array_values( $current ) : $current;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-view-config-data.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-view-config-data.php#L599)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-view-config-data.php#L599-L633)

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

| Uses | Description | 
| [WP_View_Config_Data::remove_list_member()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_list_member/)`wp-includes/class-wp-view-config-data.php` |

Removes the first list member matching an identity, leaving the rest.

  | 
| [WP_View_Config_Data::list_item_identity()](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/)`wp-includes/class-wp-view-config-data.php` |

Resolves the identity used to match a list member against another.

  | 
| [WP_View_Config_Data::remove_properties()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/)`wp-includes/class-wp-view-config-data.php` |

Removes the properties a spec names from the current value.

  |

| Used by | Description | 
| [WP_View_Config_Data::remove()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove/)`wp-includes/class-wp-view-config-data.php` |

Removes named properties from the configuration, leaving the rest alone.

  | 
| [WP_View_Config_Data::remove_properties()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/)`wp-includes/class-wp-view-config-data.php` |

Removes the properties a spec names from the current value.

  |

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

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

## User Contributed Notes

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