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

How do you register a sidebar in a plugin without screwing up the pre-existing registered sidebars? (The ordering of the sidebar registrations, rather than the assigned ID, determines the sidebar data.)

share|improve this question
up vote 7 down vote accepted
function self_deprecating_sidebar_registration(){
  register_sidebar( /* Your arguments here */ );

add_action( 'wp_loaded', 'self_deprecating_sidebar_registration' );

Most themes will register the sidebar in their functions file, which is included before init but after plugins are loaded. Hooking onto wp_loaded should guarantee that your sidebar is registered after the theme's.

share|improve this answer
I should also add that wp_loaded is the latest hook you can reliably use to register the sidebar for both admin and front end. – John P Bloch Oct 4 '10 at 16:46
Sick. I was about to look up that same information. Thanks! – Dan Gayle Oct 4 '10 at 17:21
Also, can we get some action on this? core.trac.wordpress.org/ticket/14256 – Dan Gayle Oct 4 '10 at 17:24
If you can, attend the IRC dev chat on Thurs and mention the ticket. Or email a core dev. Or bring it up on the wp-hackers list. – EAMann Oct 4 '10 at 17:33

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.