WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't remove a filter that added by media-tags plugin. it was originally added this way:

add_filter( 'attachment_fields_to_edit', 'mediatags_show_fields_to_edit', 11, 2 );

I tried to remove it this way:

remove_filter( 'attachment_fields_to_edit','mediatags_show_fields_to_edit', 11, 2 );

Where I did wrongly? How can I remove this filter?

share|improve this question
up vote 3 down vote accepted

It depends on the call sequence. Are you sure that the remove_filter is called after the add_filter and before the attachment_fields_to_edit filter is invoked? Add few trace statements and verify.

share|improve this answer
the original filter was added inside a function that hooked up with 'admin_init'. My remove_filter is hooked up with my plugin's init. I will try to change my hook to see how. thanks! – Jenny Jun 6 '12 at 6:47
You can use the same hook admin_init with a lower priority to ensure that your method is called later. – KDM Jun 6 '12 at 6:50
Thanks! it works with your solution! – Jenny Jun 6 '12 at 9:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.