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 was wondering if there was a way to unregister a widget that gets declared in the functions.php file of a parent theme from a child theme, I understand that the child's function.php file gets loaded first so I don't know how to unregister it when it hasn't been created yet.

Thanks all in advance!

share|improve this question
up vote 3 down vote accepted

Assuming the Parent Theme's Widget is registered at the widgets_init hook, all you need to do is wrap your unregister_widget() call inside of a function, hook that function into widgets_init, and give your hook a higher priority number than the Parent Theme's widgets_init-hooked function.

Assuming the Parent Theme hooks into widgets_init without giving a priority number, the function will default to 10. So, just give your hook call a priority of 11 or greater.

share|improve this answer
Thanks that did the trick! – javiervd Jun 6 '11 at 13:51

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.