Title: remove_all_filters
Published: April 25, 2014
Last modified: May 20, 2026

---

# remove_all_filters( string $hook_name, int|false $priority = false ): true

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#wp--skip-link--target)

Removes all of the callback functions from a filter hook.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#parameters)󠁿

 `$hook_name`stringrequired

The filter to remove callbacks from.

`$priority`int|falseoptional

The priority number to remove them from.

Default:`false`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#return)󠁿

 true Always returns true.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#source)󠁿

    ```php
    function remove_all_filters( $hook_name, $priority = false ) {
    	global $wp_filter;

    	if ( isset( $wp_filter[ $hook_name ] ) ) {
    		$wp_filter[ $hook_name ]->remove_all_filters( $priority );

    		if ( ! $wp_filter[ $hook_name ]->has_filters() ) {
    			unset( $wp_filter[ $hook_name ] );
    		}
    	}

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/plugin.php#L346)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/plugin.php#L346-L358)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#related)󠁿

| Used by | Description | 
| [Language_Pack_Upgrader::bulk_upgrade()](https://developer.wordpress.org/reference/classes/language_pack_upgrader/bulk_upgrade/)`wp-admin/includes/class-language-pack-upgrader.php` |

Upgrades several language packs at once.

  | 
| [WP_Query::get_posts()](https://developer.wordpress.org/reference/classes/wp_query/get_posts/)`wp-includes/class-wp-query.php` |

Retrieves an array of posts based on query variables.

  | 
| [remove_all_actions()](https://developer.wordpress.org/reference/functions/remove_all_actions/)`wp-includes/plugin.php` |

Removes all of the callback functions from an action hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#comment-content-4042)
 2.    [nosilver4u](https://profiles.wordpress.org/nosilver4u/)  [  6 years ago  ](https://developer.wordpress.org/reference/functions/remove_all_filters/#comment-4042)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%23comment-4042)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%23comment-4042)
 4.  Example:
 5.      ```php
         remove_all_filters( 'the_content' );
         ```
     
 6.  This example will remove all hooks from the_content function, for any plugin or
     theme.
      But if you only want to remove a particular set of hooks at a particular
     priority, you can use a priority, 10 being the default used for most filters:
 7.      ```php
         remove_all_filters( 'wp_delete_file', 10 );
         ```
     
 8.  Since class-derived filters can be tricky to remove, if they use a non-default
     priority (take 15 for example), you could do this instead:
 9.      ```php
         remove_all_filters( 'wp_delete_file', 15 );
         ```
     
 10.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%3Freplytocom%3D4042%23feedback-editor-4042)
 11.  [Skip to note 4 content](https://developer.wordpress.org/reference/functions/remove_all_filters/?output_format=md#comment-content-1671)
 12.   [Morteza Geransayeh](https://profiles.wordpress.org/man4toman/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/remove_all_filters/#comment-1671)
 13. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%23comment-1671)
     Vote results for this note: -4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%23comment-1671)
 14. Example:
 15.     ```php
         remove_all_filters('the_content', 'plugin_filters');
         ```
     
 16. This example will remove all of the plugins hooks from the_content function.
 17.  * What is `plugin_filters` here if the second parameter is a `$priority` number?
      * [HelgaTheViking](https://profiles.wordpress.org/helgatheviking/) [6 years ago](https://developer.wordpress.org/reference/functions/remove_all_filters/#comment-3885)
 18.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F%3Freplytocom%3D1671%23feedback-editor-1671)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_filters%2F)
before being able to contribute a note or feedback.