Skip to content

Contact Form 7 - Pre-Fill Fields for Logged-In Users

Use the default: option in Contact Form 7 tags to fill a form's name, phone and email fields from the logged-in user's profile — and see what your options are for visitors who are not logged in.

2 minute read

Contact Form 7 supports dynamic default values for logged-in users through the default: option in form tags. This is particularly useful when you want to fill in user details such as name, email, or phone number automatically, based on the currently logged-in user's profile.

Examples

plain
[text* your-name placeholder default:user_display_name]
[tel your-phone placeholder default:user_phone]
[email* your-email placeholder default:user_email]

These tags behave as follows:

  • If the user is logged in, the field is pre-filled using their profile data.
  • default:user_display_name – uses the user's display name.
  • default:user_phone – uses the user_phone meta.
  • default:user_email – uses the user's email address.
  • If the user is not logged in, the default value remains empty.

A fallback for visitors who are not logged in

If you want to provide a fallback value for non-logged-in users — showing “Your name” when nobody is logged in, for instance — this is not directly supported within a single shortcode. You cannot combine default: with a static fallback value conditionally.

There are two possible workarounds:

  1. Create two separate forms – one for logged-in users and one for guests – and display them conditionally using shortcodes or theme logic.
  2. Add custom labels above the fields instead of relying solely on placeholder values.
Outside the scope of our support
These customizations go beyond the default scope of Contact Form 7 or most themes. If you decide to implement such logic, we recommend experimenting with form duplication and conditional display methods — but we do not provide official support for these custom solutions.

Ask the people who build Listivo

We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.

Was this guide helpful?