Shortcodes reference

4 min read

5 minIntermediateUltimate Affiliate Pro 9.7+

Ultimate Affiliate Pro shortcodes add affiliate features to any page: the registration and login forms, the Affiliate Portal, affiliate details such as name or rank, and content shown only to affiliates or to referred visitors. This page lists the shortcodes and what each one shows.

Most sites need only the main shortcodes, and the setup wizard already places them on the default pages. Use the others to personalize pages or to build your own affiliate area. See Set up the registration, login and password pages for the default pages.

Before you start

  • Ultimate Affiliate Pro active, with the default pages set. See Settings overview.
  • An editor that accepts shortcodes: the Shortcode block in the block editor, or the shortcode widget of your page builder.

Copy a shortcode #

Go to Ultimate Affiliate Pro›Shortcodes. Click any shortcode to copy it, then paste it into a page.

Shortcodes screen in Ultimate Affiliate Pro, Main Shortcodes section with the Register Form, Login Form, Logout Button, Password Recovery and Affiliate Portal shortcodes
The main shortcodes.

In the block editor, add a Shortcode block and paste the shortcode. In Elementor, Divi and other builders, use their shortcode element. See Page builders.

Main Ultimate Affiliate Pro shortcodes #

ShortcodeWhat it shows
[uap-register]The affiliate registration form. Customize it in Showcases›Registration Form.
[uap-login-form]The affiliate login form. Customize it in Showcases›Login Form.
[uap-logout]A Log Out link, shown only to logged-in users.
[uap-reset-password]The lost password form. See How password reset works.
[uap-account-page]The Affiliate Portal, shown to logged-in affiliates. See Set up the Affiliate Account Page.

Check the forms in a private window

When you are logged in as administrator, the pages with the registration and login forms show a short note instead of the form. Open them in a private browser window to see what visitors see.

Show affiliate details #

Affiliate data shortcodes print one field of an affiliate. Each field has two versions.

Affiliate Data Shortcodes table in Ultimate Affiliate Pro with the first_name field and its uap-affiliate and uap-public-affiliate-info shortcodes
Pick the field, then the version you need.
1Field

The detail to print. Custom fields from your registration form are listed at the end of the table.

2Current Logged Affiliate
[uap-affiliate field="first_name"] shows the detail of the affiliate who is logged in. Use it in the Affiliate Portal or on welcome pages for affiliates.
3Based on Affiliate Link
[uap-public-affiliate-info field="first_name"] shows the detail of the affiliate who referred the visitor, read from the referral cookie. Use it on landing pages, for example “You were invited by Emma”.
FieldPrints
usernameWordPress username.
first_name, last_nameFirst and last name.
user_idWordPress user ID.
affiliate_idAffiliate ID.
user_emailEmail address.
user_urlWebsite from the profile.
rank_id, rank_nameRank ID and rank name, such as Gold.
uap_avatarProfile picture, as an image.
account_page, login_pageURL of the Affiliate Portal and of the login page.
blogname, blogurl, siteurlSite title and site URL.

When there is no logged-in affiliate, or no referral cookie, these shortcodes print nothing.

Show content to some visitors only #

The Additional Shortcodes section has a button and four wrappers. Put text, images or links between the opening and closing tag; they show only to the visitors that match.

Additional Shortcodes section in Ultimate Affiliate Pro with uap-user-become-affiliate, if_affiliate, if_not_affiliate, visitor_referred and visitor_not_referred
Buttons and conditional wrappers.
ShortcodeShows the content to
[uap-user-become-affiliate]Logged-in users who are not affiliates yet: a Become an Affiliate button. See Turn existing users and customers into affiliates.
[if_affiliate] … [/if_affiliate]Logged-in, active affiliates.
[if_not_affiliate] … [/if_not_affiliate]Visitors who are not logged in and users who are not affiliates.
[visitor_referred] … [/visitor_referred]Visitors who arrived through an affiliate link and have the referral cookie.
[visitor_not_referred] … [/visitor_not_referred]Visitors without a referral cookie.

Example

[if_affiliate]
Welcome back! Your new banners are ready in the Affiliate Portal.
[/if_affiliate]

[if_not_affiliate]
Earn 20% on every sale. Join our affiliate program today.
[/if_not_affiliate]

Put affiliate data shortcodes, such as [uap-affiliate field="first_name"], directly on the page, outside the wrappers.

Pages with referral content and caching

Shortcodes that read the referral cookie change the page for each visitor. If you use a page cache, exclude those pages from it. See Cache plugins and host caching.

Other shortcodes #

ShortcodeWhat it does
[uap-listing-affiliates …]A leaderboard of your top affiliates by earnings, referrals or clicks. Build it in Showcases›Top Affiliates with the Shortcode Generator and click Copy ShortCode, because it needs several attributes.
[uap-landing-commission slug="…"]Gives a landing commission when a referred visitor reaches the page. Nothing is shown. See Landing commissions.
[uap-product-links]The Product Links tool, where affiliates search products and copy their links. Turn on the Product Links module first; it also adds the tool to the Affiliate Portal.

The Extended Shortcodes add-on adds more shortcodes, such as content for logged-in affiliates and visitors, and links to the login page.

Test it #

  1. Create a test page with [uap-affiliate field="first_name"], [if_affiliate]You are an affiliate[/if_affiliate] and [if_not_affiliate]Join us[/if_not_affiliate].
  2. Open the page while logged in as an affiliate, for example emma.collins. You see “Emma” and “You are an affiliate”.
  3. Open the page in a private window. You see “Join us”.

Frequently asked questions #

Where do I find all Ultimate Affiliate Pro shortcodes?

Go to Ultimate Affiliate Pro, Shortcodes. Click a shortcode to copy it.

Which shortcode shows the affiliate dashboard?

[uap-account-page]. It shows the Affiliate Portal to logged-in affiliates. Select that page in the plugin settings as the Affiliate Portal page.

Why does the registration form not show when I am logged in?

Administrators see a short note instead of the registration and login forms. Open the page in a private browser window.

How do I show the name of the affiliate who referred a visitor?

Use [uap-public-affiliate-info field=”first_name”]. It reads the referral cookie, so it works after the visitor arrives through an affiliate link.

Can I use the shortcodes in Elementor or Divi?

Yes. Paste them into the shortcode element of your page builder.

How do I show content only to affiliates?

Wrap it in [if_affiliate] and [/if_affiliate]. Use [if_not_affiliate] for everyone else.

What’s next #

What are your feelings

  • Happy
  • Normal
  • Sad