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 have a problem of widgets not showing up, trying to investigate why $wp_registered_widgets is empty.

Can somebody tell me where it gets filled from the database? How can I find out why the default widgets are not set.

share|improve this question
up vote 3 down vote accepted

As you can see here, $wp_registered_widgets is defined in wp-includes/widgets.php (as expected). You should be able to debug it by doing something like this:

function yoast_print_active_widgets() {
    global $wp_registered_widgets;    
    echo '<pre>'.print_r( $wp_registered_widgets, 1 ).'</pre>';

Then you could loop through the different stages, from init, to send_headers to wp_head and see where stuff goes wrong...

share|improve this answer

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.