WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/delete option

Description

A safe way of removing a named option/value pair from the options database table.

Usage

<?php delete_option$option ); ?>

Parameters

$option
(string) (required) Name of the option to be deleted. A list of valid default options can be found at the Option Reference.
Default: None

Return Value

(boolean) 
True, if option is successfully deleted. False on failure, or option does not exist.

Example

Delete a single option

This will delete 'my_option' from the options table within your MySQL database.

<?php delete_option( 'my_option' ); ?>

Change Log

Since: 1.2.0

Source File

delete_option() is located in wp-includes/option.php.

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.