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 am currently developing a multi-site plug-in for WordPress. I need to run a function when a new site is created.

share|improve this question

I guess you are looking for an action/filter.

wpmu_new_blog this action is fired in wpmu_create_blog function (wp-includes/ms-functions.php)

do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
share|improve this answer
I need to run my custom function when a new site is created – Varun Sridharan Feb 25 '13 at 6:02
I need to teach you how to hook action? – Jesse Feb 25 '13 at 6:02
if possible can u ? – Varun Sridharan Feb 25 '13 at 6:04
Actions and filters are the fundamental knowledge of wordpress plugin development. Hooking an action is the most basic stuff. If you have no idea what they idea, I would suggest googling about add_action first. – Jesse Feb 25 '13 at 6:12

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.