Title: remove_all_actions
Published: April 25, 2014
Last modified: February 24, 2026

---

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

## In this article

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

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

Removes all of the callback functions from an action hook.

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

 `$hook_name`stringrequired

The action 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_actions/?output_format=md#return)󠁿

 true Always returns true.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/remove_all_actions/?output_format=md#more-information)󠁿

Prior to Version 4.7

 * You can’t call this function from within the hook you would like to remove actions
   from. For example adding an action to wp_footer that calls `remove_all_actions('
   wp_footer')` will cause an infinite loop condition because the while loop suddenly
   doesn’t have a next value. In WordPress 3.8.1 you’ll get a warning message like:
   `
   Warning: next() expects parameter 1 to be array, null given in wp-includes/plugin.
   php on line 431`
 * You’ll just need to hook into a hook that’s called before the hook you wish to
   clear is called.

Since Version 4.7, these limitations have been addressed. Please refer to [https://wordpress.org/support/wordpress-version/version-4-7/#for-developers](https://wordpress.org/support/wordpress-version/version-4-7/#for-developers)

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

    ```php
    function remove_all_actions( $hook_name, $priority = false ) {
    	return remove_all_filters( $hook_name, $priority );
    }
    ```

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

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

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

Removes all of the callback functions from a filter hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/remove_all_actions/?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_actions/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/remove_all_actions/?output_format=md#comment-content-1672)
 2.    [Morteza Geransayeh](https://profiles.wordpress.org/man4toman/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/remove_all_actions/#comment-1672)
 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_actions%2F%23comment-1672)
     Vote results for this note: 2[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_actions%2F%23comment-1672)
 4.  Example:
 5.      ```php
         remove_all_actions('the_content');
         ```
     
 6.  This example will remove all of the hooks from the_content function.
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_actions%2F%3Freplytocom%3D1672%23feedback-editor-1672)
 8.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/remove_all_actions/?output_format=md#comment-content-7130)
 9.    [Pixelbart](https://profiles.wordpress.org/pixelbart/)  [  2 years ago  ](https://developer.wordpress.org/reference/functions/remove_all_actions/#comment-7130)
 10. [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_actions%2F%23comment-7130)
     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_actions%2F%23comment-7130)
 11. If you want only show the admin bar, you can use this:
 12.     ```php
         remove_all_actions( 'wp_head' );
         remove_all_actions( 'wp_footer' );
     
         // Add default wp_head actions
         add_action( 'wp_head', '_admin_bar_bump_cb', 0 );
         add_action( 'wp_head', 'wp_print_styles', 8 );
         add_action( 'wp_head', 'wp_print_head_scripts', 9 );
     
         // Add default wp_footer actions
         add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
     
         // Add admin bar initialization actions
         add_action( 'template_redirect', '_wp_admin_bar_init', 0 );
         add_action( 'admin_init', '_wp_admin_bar_init' );
         add_action( 'before_signup_header', '_wp_admin_bar_init' );
         add_action( 'activate_header', '_wp_admin_bar_init' );
     
         // Render admin bar in the footer and admin header
         add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
         add_action( 'in_admin_header', 'wp_admin_bar_render', 0 );
         ```
     
 13. And if you use the action `wp`, you can use `get_query_var` for custom templates
     or other things. Just like that:
 14.     ```php
         add_action( 'wp', function() {
             if ( get_query_var( 'my_var' ) ) {
                 // code from above here
             }
         } );
         ```
     
 15.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_all_actions%2F%3Freplytocom%3D7130%23feedback-editor-7130)

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