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 need a plugin or some guidence on creating a user's own folder on user registation.

For example...A user clicks on Register and registers ... I need wordpress to create a directory which would be linked with this user.

The reason I want to do this is because I am going to work on building a dashboard where a wordpress template will display the contents of this user's own directory.

Let me explain further step by step: (Note: "Not Req" means I don't need help with this step)

  1. User Registers and wordpress creates a directory called the same as the username.
  2. User uploads images to that specific directory via ftp or upload - "Not Req"
  3. I create a template that would display the content of the directory / sub (images) in some kind of tree format.

Right now, what I need to do is step 1.

Hope this helps.

share|improve this question
Do you mean an upload directory? Besides that WordPress works with virtual paths only, there are no dedicated directories for anything. – toscho May 3 '12 at 20:55
Give us more on your intent & we will suggest you a good implementation – Ashfame May 3 '12 at 20:58
up vote 4 down vote accepted

You can use the user_register action to hook into the register proces and then create the user directory with wp_mkdir_p.

function create_user_dir($user_id) {
    $user_info = get_userdata( $user_id );

    $upload_dir = wp_upload_dir();
    $user_dir = $upload_dir['basedir'] . '/user_dirs/' . $user_info->user_login;

add_action( 'user_register', 'create_user_dir');

This example makes a directory in uploads/user_dirs.


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.