Function: delete_option

delete_option( string $option )

Removes option by name. Prevents removal of protected WordPress options.

Shortcut: do

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.


Name Type(s) Default Value Description
$option string

Name of option to remove. Expected to not be SQL-escaped.



True, if option is successfully deleted. False on failure.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.