The shortcode reference includes all shortcodes available for UserPro, plus all options you can use within the shortcodes and what they do exactly. Use this guide to create the shortcode you want and customize it to your needs.

General Shortcode Options

This is documentation for general shortcode options. For detailed options for each shortcode, you can skip that part.

Available Options

template

The template tells UserPro which template to show. E.g. template=login, template=view, template=register etc.

max_width

This sets the plugin width. By default this is set to 480px. (Or whatever option you set for width in backend) To make the plugin shortcode expand to 100%, use max_width=100% % or px values are accepted. This option can be set globally in plugin settings.

profile_thumb_size

This option controls the thumbnail size of profile picture in view/edit mode. Enter numeric size. By default this is set to 100. e.g. profile_thumb_size=80 will show 80 pixels profile picture.

no_header

If you set this option to true, the shortcode header will not be displayed allowing you to put your custom header.

no_style

If you set this option to true, the shortcode will appear in a plain style to match your own design/background.

layout

This controls the layout of fields. The value can be ‘float’ or ‘none’, by default this value is ‘float’ It means the label will try to float to left of field. If you set this to none, the label will be on a seperate line in your form.

margin_top

Set the top margin of your shortcode. By default, the top margin is 0.

margin_bottom

Set the bottom margin of your shortcode. By default, the bottom margin is 30px.

align

This option controls the alignment of your shortcode. By default align is set to ‘center’. Possible values are center, left, right, or none.

skin

Skin name to use for this shortcode. By default, skin is set in plugin settings. Default skin is ‘default’.

keep_one_section_open

This can be 1 or 0. If this is turned on, only one collapsible section will be open at one time. To disable this, please set this option to 0.

allow_sections

This option can turn on/off field groups/sections even If you have sections enabled on your form. If you set this to 0, sections will be disabled and fields will appear without sections. Default value is 1.

[userpro template=view]

Responsible for showing profiles on the frontend.

Available Options

user

To show the profile of post author, use user=author, and If you want to show or promote the profile of specific user, set user=Username in your shortcode. By default the shortcode displays the current profile, or viewed profile via URL.

header_only

Set header_only=true to show the profile header only (compact view) without the full profile details. Perfect if you want to show profile heading only including social icons and not the complete profile.

include_fields

A comma seperated list of custom fields (or field keys) you want to show in the profile view only. This will exclude any other fields than the one you specify in that option.

include_fields_by_name

The same as above option but uses field name instead of field key (e.g. include_fields_by_name=”First Name,Last Name”) will show only first and last name on the profile.

include_fields_by_type

This include fields based on the allowed field types you set here. A comma seperated list of field types will work. Example: include_fields_by_type=select,radio will show only these fields that are select dropdown or radio group. include_fields_by_type=picture,file will include only photo upload fields and files.

exclude_fields

A comma seperated list of custom fields (or field keys) you want to exclude from profile view.This will include any other fields than the one you specify in that option.

exclude_fields_by_name

The same as above option but uses field name instead of field key (e.g. exclude_fields_by_name=”Age,Region,etc.”) will exclude these fields from appearing on profile.

exclude_fields_by_type

This exclude fields based on field types you set here. A comma seperated list of field types will work. Example: exclude_fields_by_type=textarea will hide any fields that are textarea fields. exclude_fields_by_type=picture,file will exclude photo upload fields and files.

[userpro template=memberlist]

This shortcode displays the member directory. The shortcode has many options that you can customize.

Available Options

memberlist_v2

This can be 1 or 0. Enable/disable the new member directory (v2) It is enabled by default, but you can turn it off by setting this to 0.

memberlist_v2_pic_size

This controls the size of user picture in memberlist v2, default is 86 (pixels)

memberlist_v2_fields

A comma seperated list of fields that will be displayed below user name in member directory. By default this option is set to memberlist_v2_fields=age,gender,country by default. To customize this option pass a comma seperated list of fields to display here. Example: memberlist_v2_fields=city,age,country

memberlist_v2_bio

Show/hide the user description in member directory v2, by default this is set to 1. To turn it off set it to 0.

memberlist_v2_showbadges

This option can be 1 or 0, it shows/hides the user badges from member directory v2.

memberlist_v2_showname

This option can be 1 or 0, it shows/hides the user display name from member directory v2.

memberlist_pic_size

This controls the user image size in the standard member directory, by default the image is 120 (pixels)

memberlist_pic_topspace

This is the top margin of each result in member directory in pixels. Enter 0 to remove all margin on top. Default is 15 pixels.

memberlist_pic_sidespace

This is the side margin of each result in member directory in pixels. Enter 0 to remove all margin on sides. Default is 30 pixels.

memberlist_pic_rounded

This can be 1 or 0. Enable/disable rounded user images in member directory.

memberlist_width

This controls the maximum width of member directory relative to its parent. For example, if you want it to take only 50% of the parent, enter 50% in this option. By default it is set to 100% of its parent.

memberlist_paginate

Turn on/off pagination on member directory. By default this is set to 1 (Enabled)

memberlist_paginate_top

Turn on/off top side pagination on member directory. By default this is set to 1 (Enabled)

memberlist_paginate_bottom

Turn on/off bottom side pagination on member directory. By default this is set to 1 (Enabled)

memberlist_show_name

Show or hide the user name in member directory. This can be 1 or 0.

memberlist_popup_view

If set to 1, profiles will open in a popup instead of opening in new link. By default this is disabled (set to 0)

memberlist_withavatar

Show only members who have custom avatar. This is turned off by default, to enable set it to 1.

memberlist_verified

When turned on (set to 1) it will list only these members that have been verified by admin and have the Verified badge beside their name. By default this is turned off.

memberlist_filters

A comma seperated list of custom fields that you want to allow for searching thru the main search input. Left blank by default. (Since you can now add custom search filters seperately! Please look at the tutorial in the forum.)

per_page

How many members do you want to show per page. Default is 12

sortby

This controls the way members are sorted. By default this is set to ‘registered’ ordering members by registration date.

order

This can be desc or asc. It means order results in Ascending vs Descending mode.

relation

This can be either ‘and’ or ‘or’. It controls the relation between custom queries sent to do a custom filter/search on member. Example, when using ‘and’ as relation, you can filter users who are Male and live in Japan, and If set to ‘or’ you can get users who are Male OR live in Japan.

search

Turns on/off search feature on your member directory shortcode. By default this is set to 1.

role

Passing role=X will return users who have a specific role only. This can be multiple roles also. Example: role=author will return authors only, role=author,editor will return both authors and editors, etc.

Custom Field Filtering

To return users who meet a custom field condition. You can pass in this format custom_field=custom_value. Examples: country=”United States” will return all users from United States, you can also use comparison for example age=”18:25″ will match condition that user must be between 18 and 25 years whilst mixing custom fields like this: age=”>18″ country=”United States” will return users who live in Unites States and are older than 18 years old. You can use your custom fields to do custom filters the same way.

[userpro template=card]

Display beautiful profile cards anywhere for the users you want. By default this shortcode shows the profile card of current profile.

Available Options

user

This can be ‘author’ or ‘custom_username’, if you set this to author, the card of post author will be dynamically shown (e.g. on his posts/pages, etc). If you set user to a custom username, the card of that user will be displayed. Most regular usage is user=”author” which will display the card of author automatically.

card_width

This is the optimal card width, should be a complete value including pixels. The default value is 250px.

card_img_width

Should match the card width except that you do not need ‘px’ in the value.The default value is 250.

card_showsocial

This can turn on/off the social links in the elegant card profile. Default value is 1.

card_showbio

This can turn on/off the user description in the elegant card profile. Default value is 1.

[userpro template=list]

Show members in a compact list/style.

Available Options

list_heading

This overrides the default heading title for this widget. Default heading is ‘Latest Members’.

no_heading

Setting this to true will disable the heading from this widget so you can apply your custom coded heading.

no_style

Setting this to true will disable the default box style applied to the compact members list so you can integrate/make it look like part of your background and design.

list_per_page

Number of members to return. By default the plugin will return 5 users in compact list. You can adjust that number via this option list_per_page=X.

list_sortby

Sort members by which rule, by default it sort members by ‘registered’ (Registration date) you can change this setting to sort members by name, e-mail, or another supported sorting method by WordPress.

list_order

The order in which members are displayed. By default it sort members in descending mode, default value is ‘desc’.

list_users

A comma seperated list of the users you want to promote or show in your compact members list. This will override the default members and will show only users you specify here. For example, you can show staff, or specific users (list_users=user1,user2,user3) etc.

list_thumb

This controls the width of thumbnail that is being displayed in compact member list. By default this is set to 50.

list_showthumb

This can turn on/off the thumbnail display in compact members list. Default value is 1.

list_showsocial

This can turn on/off the social links in compact members list. Default value is 1.

list_showbio

This can turn on/off the user description in compact members list. Default value is 1.

list_verified

If you set this to 1 It means you will show only members who have the verified badge on their profile. Default is 0 turned off.

list_relation

This controls the relation of meta queries, can be either ‘and’ or ‘or’. The default value is ‘or’.

[userpro template=register]

Embeds the registration shortcode where the shortcode is placed.

Available Options

register_heading

This overrides the default heading that displays in Registration form. Default heading is Register an Account.

register_side

This controls the side text link in Registration heading. Default is ‘Already a member?’

register_side_action

This is the action that is taken when the link is clicked on side. Default to ‘login’ will show a login form to user.

register_button_primary

This is the text that appears on Register button. Default to Register.

register_button_secondary

This is the text that appears on 2nd button, default to Login. Leave blank to disable this button.

register_button_action

This is the action that happens when the 2nd button is active (if it is enabled). By default it is set to ‘login’ (Will login user instead of register)

register_redirect

This is blank by default. Enter a custom URL if you want users to be redirected to a specific page after registration.

register_recaptcha

This can turn on/off recaptcha on registration forms. By default this is set to the global option you specified in plugin options for this.

[userpro template=login]

Embeds the login shortcode where the shortcode is placed.

Available Options

login_heading

This overrides the default heading that displays in Login form. Default heading is Login.

login_side

This controls the side text link in Login form heading. Default is ‘Forgot your password?’

login_side_action

This is the action that is taken when the link is clicked on side. Default to ‘reset’ will show a password reset form.

login_button_primary

This is the text that appears on Login button. Default to Login.

login_button_secondary

This is the text that appears on 2nd button, default to Create an Account. Leave blank to disable this button.

login_button_action

This is the action that happens when the 2nd button is active (if it is enabled). By default it is set to ‘register’ (Will register user instead of login)

login_redirect

This is blank by default. Enter a custom URL if you want users to be redirected to a specific page after login.

login_recaptcha

This can turn on/off recaptcha on login forms. By default this is set to the global option you specified in plugin options for this.

[userpro template=postsbyuser]

Display the posts made by user in grid or simple list layout.

Available Options

postsbyuser_mode

This can be ‘grid’ or ‘compact’. Choose in which layout to show the posts made by user.

postsbyuser_num

Number of posts to return. Default is 12.

postsbyuser_types

This controls which post types are included in the post list. By default it shows ‘posts’ only. You can enter a comma seperated list of post types, e.g. to show posts, products, and custom post type enter postsbyuser_types=post,product,custom_type and to show all post types use postsbyuser_types=any (This option uses custom post type slugs)

postsbyuser_thumb

This controls the size of post thumbnail if you are using ‘compact’ mode to display post list. By default this is set to 50 pixels.

postsbyuser_showthumb

This show/hide the thumbnail of post when using the ‘compact’ mode to display post list. By default this is set to 1.

user

This option can specify which user to return post list for. By default, it displays current user posts, or current profile posts. To show posts made by AUTHOR, set user=author and to show posts made by specific user set user=Custom_user