I am wondering if something like this is possible? If so, where would I start! I'm certainly not looking for someone to explain 100% fully and give free code examples etc, only a nudge in the right direction. :)

I've done some exhaustive Google searching and I believe I might not be searching for the right things.

Here's hoping!

All the best

  • 1
    Without knowing what you want to do exactly: I am not sure if this is what WordPress is made for. If you want to stick to WordPress, then I actually wouldn't create a real page for every user. Instead, maybe look into creating a template that dynamically displays the user name/data. I might be able to answer your question, but please add some more background info.
    – Sven
    Oct 11 '14 at 18:43
  • +1 for @Sven also what do you mean exactly with "existing template"?
    – gmazzap
    Oct 12 '14 at 3:52
  • An existing template, I meant a custom template that you can make in wordpress, on the publish area, where the drop-down template list is. I've created one that I am trying to get the page that is auto created upon user registration to use. I do hope this makes more sense.
    – JohnDollop
    Oct 12 '14 at 14:19

First off, it sounds like you might be able to solve your underlying question using BuddyPress.

If you simply want to make an actual WordPress page if a user registers you can do that using the user_register hook. The hook receives the newly created user ID.

This code example should create a page with the user's nicename.

add_action( 'user_register', 'myplugin_add_page_for_user' );

function myplugin_add_page_for_user( $user_id ) {

    // Get the user for this user_id
    $user = get_user_by( 'id', $user_id );

    // The data for the page we are going to add
    $page_data = array(
        'post_type'  => 'page',
        'post_title' => $user->user_nicename

    // Actually insert the post
    wp_insert_post( $page_data );

  • I think your function name doesn't match the add_action call. And I would include post_status and page_template in $page_data. Also - is user_nicename unique? Otherwise that could cause problems. Agree that BuddyPress could be a better solution.
    – shanebp
    Oct 11 '14 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.