Title: Automatically generated pages
Last modified: August 19, 2016

---

# Automatically generated pages

 *  [crewsin08](https://wordpress.org/support/users/crewsin08/)
 * (@crewsin08)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/automatically-generated-pages/)
 * Hi Everyone,
 * I need my site to automatically create a new page when somebody registers with
   the page name being the username of that user. wondering if anybody can help 
   me out, i am relatively new to wordpress and php so any help would be awesome.
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [crewsin08](https://wordpress.org/support/users/crewsin08/)
 * (@crewsin08)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/automatically-generated-pages/#post-1855748)
 * Hi guys after a solid night of trial and error i managed to come up with this.
   seems to work pretty well, if anybody has a better idea i am happy for input.
 * Simply copy paste into your functions.php file and it will take effect
 * /* CREATE NEW PAGE WITH USER, GIVE PAGE USER’S NAME*/
    function my_create_page(
   $user_id){ $the_user = get_userdata($user_id); $new_user_name = $the_user->user_login;
   $my_post = array(); $my_post[‘post_title’] = $new_user_name; $my_post[‘post_type’]
   = ‘page’; $my_post[‘post_content’] = ”; $my_post[‘post_status’] = ‘publish’; 
   wp_insert_post( $my_post ); } add_action(‘user_register’, ‘my_create_page’);

Viewing 1 replies (of 1 total)

The topic ‘Automatically generated pages’ is closed to new replies.

## Tags

 * [pages](https://wordpress.org/support/topic-tag/pages/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [crewsin08](https://wordpress.org/support/users/crewsin08/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/automatically-generated-pages/#post-1855748)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
