Apps Ballance Cash_2 Chat Checkout Click Code Cog_Wheels Compose_email Conference Contacts Earth Edit_File_1_ Email Email_2 File Folder_2 Gift Group Group_2 Help ID ID_2 Key Keys Laptop_Store Like_1_ Link Lock Log_Out Map Marketing Mobile_UI Navigation POS Partnership Profile Safe_2 Search_User Secure_Files Settings Share Shield Shield_2 Shopping_Cart Support_Male Trash Type_pin User_female User_male logo copy

Setting a Default Value for a Field

Iain Poulson avatar
Iain Poulson Last updated on March 6, 2021

As of WP User Manager v2.5, you can set the default value of text, hidden, number, radio, dropdown, and textarea fields on registration forms. You can do this by –

  • Navigate to Users > Custom Fields
  • Edit the field 
  • Scroll down in the General tab to see the ‘Default Value’ setting

The default value will only be populated on the registration forms.

Setting a Default Value From a Query String

A query string is part of a URL that contains information, in the format https://mysite.com?key=value

You can populate the default value of a field using the value of a query string using the following method.

  • Work out the query string key you will use, eg. https://mysite.com/register?item=yoga the key will be ‘item’
  • Edit the field and add the default value as {query_var key=”item”} (replacing item for your key)

When this field is used on registration forms, the value will be auto-filled based on the value of the query string. So for my example of  https://mysite.com/register?item=yoga, this field above will have the value ‘yoga’ by default.

WP User Manager logo

Get Started with the Best WordPress Membership Plugin Today

Connect, Manage and Build your Membership Site

Need more help?

If you still didn't find an answer you can always contact us

Submit a ticket