Title: pre filled user fields
Last modified: February 15, 2023

---

# pre filled user fields

 *  Resolved [Ian](https://wordpress.org/support/users/iany/)
 * (@iany)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/pre-filled-user-fields/)
 * hi ive been sent here from your pre sales chat to request the code snippet that
   will enable fields such as name and email to be pre – filled if the user is logged
   in?
 * thanks in advance.
 * Ian

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/pre-filled-user-fields/#post-16476145)
 * Hi [@iany](https://wordpress.org/support/users/iany/)
 * I hope you are doing well today.
 * You can set the pre-fill for some of your fields and then use this custom snippet
   code to auto-fill them:
 *     ```wp-block-code
       add_filter( 'forminator_cform_render_fields', function( $wrappers, $form_id ){
       	if( $form_id === 123 && is_user_logged_in() ){
       		$current_user = wp_get_current_user();
   
       		$_REQUEST['user-login'] = $current_user->user_login;
       		$_REQUEST['user-email'] = $current_user->user_email;
       		$_REQUEST['user-firstname'] = $current_user->user_firstname;
       		$_REQUEST['display-name'] = $current_user->display_name;
       	}//End check form id.
       	return $wrappers;
       }, 10, 2 );
       ```
   
 * where 123 is an ID of your form. You can find your form ID in the page source
   where the form is located, or edit your form in WP Dashboard and the URL of that
   page edit will contain that ID.
 * You can add the above snippet as a mu-plugin on your site:
   [https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins](https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins)
 * Kind Regards,
   Kris
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/pre-filled-user-fields/#post-16494105)
 * Hello [@iany](https://wordpress.org/support/users/iany/) ,
 * We haven’t heard from you for several days now, so it looks like you don’t have
   more questions for us.
 * Feel free to re-open this ticket if needed.
 * Kind regards
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)

 The topic ‘pre filled user fields’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/pre-filled-user-fields/#post-16494105)
 * Status: resolved