delete_site_meta_by_key() WordPress Function

The delete_site_meta_by_key() function allows you to delete a site meta key and its corresponding value from the database. This function is useful for cleaning up after a plugin or theme has been uninstalled, or if you simply want to remove a key/value pair from the database.

delete_site_meta_by_key( string $meta_key ) #

Deletes everything from site meta matching meta key.


Parameters

$meta_key

(string)(Required)Metadata key to search for when deleting.


Top ↑

Return

(bool) Whether the site meta key was deleted from the database.


Top ↑

Source

File: wp-includes/ms-site.php

function delete_site_meta_by_key( $meta_key ) {
	return delete_metadata( 'blog', null, $meta_key, '', true );
}


Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.