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.
Return
(bool) Whether the site meta key was deleted from the database.
Source
File: wp-includes/ms-site.php
function delete_site_meta_by_key( $meta_key ) { return delete_metadata( 'blog', null, $meta_key, '', true ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.1.0 | Introduced. |