Codex

Function Reference/remove filter

Contents

Description

This function removes a function attached to a specified filter hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute. See also remove_action(), add_filter() and add_action().

Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.

Parameters

$tag
(string) (required) The action hook to which the function to be removed is hooked.
Default: None
$function_to_remove
(string) (required) The name of the function which should be removed.
Default: None
$priority
(int) (optional) The priority of the function (as defined when the function was originally hooked).
Default: 10
$accepted_args
(int) (optional) The number of arguments the function accepts.
Default: 1

Return

(boolean
Whether the function is removed.
  • True - The function was successfully removed.
  • False - The function could not be removed.

Example

Notes

Change Log

Since: 1.2.0

Source File

remove_filter() is located in wp-includes/plugin.php.

Related

Filters: add_filter, has_filters, apply_filters, remove_filter, remove_all_filters, current_filter, merge_filters

See also index of Function Reference and index of Template Tags.