
At some point during your development of WordPress plugins, you may need to be able to “undo” changes in filters and actions made by the WordPress core or by another installed plugin. We can achieve this by stopping the modifying plugin from successfully hooking into a filter or action.
You may need to do this if something is conflicting with what your plugin is trying to achieve (or you may want to remove some annoyance added somewhere). For example, if you do not like how WordPress automatically adds p tags into posts, you could prevent that function from hooking into the filter.
Now, let’s look at how we would accomplish the example above. Before we can remove the filter or action, however, we need to know a couple of things. The first is the filter or action name that we want to remove a function from and the second is the name of the function that we want to remove. We can get this information be looking at the add_filter or add_action line for the filter/action function we want to remove.
In this case, the function wpautop is hooking into the filter the_content. So, to remove this, we will use the function remove_filter (you would use remove_action to remove an action):
[code='php']remove_filter( 'the_content', 'wpautop' );[/code]
If the hook uses a different priority than the default, you will need to specify this as the third parameter. This line will then remove the wpautop function from filtering the_content. It’s as simple as that.
Many of WordPress’ default filters and actions can be found in wp-includes/default-filters.php.




