Contact Form 7 supports the use of dynamic default values for logged-in users by using the default: option in form tags. This is particularly useful when you want to automatically fill in user details such as name, email, or phone number based on the currently logged-in user's profile.
Examples
[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 will be 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 will remain empty.
If you want to provide a fallback value for non-logged-in users (e.g., show “Your name” if no user is logged in), this is not directly supported within a single shortcode. Unfortunately, you cannot combine default: with a static fallback value conditionally.
There are two possible workarounds:
- Create two separate forms – one for logged-in users and one for guests, and display them conditionally using shortcodes or theme logic.
- Add custom labels above fields instead of relying solely on placeholder values.
Please note: These customizations are 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. However, we do not provide official support for these custom solutions.