remove_all_filters( string $tag, int|false $priority = false )

Remove all of the hooks from a filter.

Parameters Parameters


(string) (Required) The filter to remove hooks from.


(int|false) (Optional) The priority number to remove.

Default value: false

Top ↑

Return Return

(true) True when finished.

Top ↑

Source Source

File: wp-includes/plugin.php

function remove_all_filters( $tag, $priority = false ) {
	global $wp_filter;

	if ( isset( $wp_filter[ $tag ] ) ) {
		$wp_filter[ $tag ]->remove_all_filters( $priority );
		if ( ! $wp_filter[ $tag ]->has_filters() ) {
			unset( $wp_filter[ $tag ] );

	return true;

Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by nosilver4u


    remove_all_filters( 'the_content' );

    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:

    remove_all_filters( 'wp_delete_file', 10 );

    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:

    remove_all_filters( 'wp_delete_file', 15 );
  2. Skip to note 2 content


    remove_all_filters('the_content', 'plugin_filters');

    This example will remove all of the plugins hooks from the_content function.

You must log in before being able to contribute a note or feedback.