Affiliates – Shortcodes

The information on this page is outdated. Please refer to the Documentation..

Note: From release 1.3.1, you can go to Affiliates > Options and press the Generate button which will create the default Affiliate Area.

For complete details on shortcodes please visit the Shortcodes section in the documentation.

Information for affiliates

Affiliate link

Embed this shortcode on a page:


This will render a link to your site with the affiliate ID appended.

If you want to link to a certain page, you can use this shortcode:


If you want to show how a link would look like, you can use the shortcode within HTML as well, for example:

<a href=”[affiliates_url]”>[affiliates_url]</a>

Remember to use HTML entities for < and >.

Affiliate earnings & performance

Your affiliates will want to know how much they will and have earned and how many referrals they have made.

Use the [affiliates_referrals] shortcode to show how many referrals an affiliate has made and how much the affiliate has earned.

The [affiliates_referrals] shortcode will show the total number of referrals that have been accepted or closed for the affiliate.

To show the number of referrals for an affiliate by status, embed it like this:


– Accepted referrals: [affiliates_referrals status=”accepted”]
– Closed referrals: [affiliates_referrals status=”closed”]
– Pending referrals: [affiliates_referrals status=”pending”]
– Rejected referrals: [affiliates_referrals status=”rejected”]

If you add the show=”total” attribute to that shortcode, it will make a list of earnings by currency:


Total amount for paid and unpaid referrals: [affiliates_referrals show=”total”]

– Total for unpaid referrals: [affiliates_referrals show=”total” status=”accepted”]
– Total for paid referrals: [affiliates_referrals show=”total” status=”closed”]
– Total for referrals pending approval: [affiliates_referrals show=”total” status=”pending”]
– Total for rejected referrals: [affiliates_referrals show=”total” status=”rejected”]

Content visibility

* Embed the content that you want to show to affiliates like this:


This is visible to affiliates who are logged in only.


* For content to show to non-affiliates use this:


You can see this if you are not logged in as an affiliate.


Login and Logout

Use the following shortcode to allow users to log in and remain on the same page after having logged in. This shortcode also accepts an optional redirect_url attribute to redirect the user to a different page after logging in.


[affiliates_login_redirect redirect_url=””]

Use the following shortcode to embed a Log out link on a page:


Affiliate Registration

Shortcode tag

[affiliates_registration /]


Lets visitors sign up to your affiliate program in a fully automated process.



Must be set to true if the shortcode is used in a widget.

default: false


Profile link text to be displayed for registered users after signing up for the affiliate program.


Profile Link for registered users after signing up for the affiliate program.


Whether to redirect after registration.

default: false


Redirection URL.


ID of the post with affiliate terms and conditions.


This feature is also available as the Affiliates Registration widget.

Affiliates Pro provides additional shortcodes for affiliate links, banners and stats.

117 Responses to Affiliates – Shortcodes

  1. 3mpstudio January 22, 2015 at 1:09 am #

    Hi, can I use a page from a different domain to link that affiliate URL? Will it record the visit of the referral?
    For example:
    Affiliate and WooCommerce is setup at
    But the sales page is at
    Should i use this short code?

    Is that correct? Will it record the referral even it’s on a different domain? thanks!

    • kento January 26, 2015 at 11:25 am #


      No that would not work, the affiliate links need to point to the domain where the affiliate system is running.


  2. Richard Egan December 8, 2014 at 12:37 pm #

    Hi there,

    The shortcode [affiliates_url] doesn't work. When placed in front of a link and [/affiliates_url] placed after the link, the link is not rendered on the page. Just empty space.

    • kento December 9, 2014 at 12:03 pm #

      Hi Richard,

      If the content within the enclosing shortcodes is empty, this would be because you are not logged in as an affiliate. Try to view the page where you have placed it using an affiliate user account please.


  3. Sue December 2, 2014 at 9:40 pm #

    Hello, Can you tell me if there is a way to change the parameter of the user ID to a higher number? I’d rather not start off at 2 for my ID number. Thank you.

    • kento December 9, 2014 at 12:15 pm #

      Hi Sue,

      The IDs are generated automatically and can’t be changed but you can create dummy accounts manually before adding affiliates.


  4. Abdul Wahab October 13, 2014 at 10:55 am #

    Sir i am posting this code in pages or post like that [referrer_id] and this is not working showing blank space

    • antonio October 13, 2014 at 3:56 pm #

      you could try:
      1.- Enable debugging for WordPress, in wp-config.php add/change these lines:
      define( ‘WP_DEBUG’, true );
      define( ‘WP_DEBUG_LOG’, true );
      2.- Visits the page that generates the error.
      3. Disable debugging
      define( ‘WP_DEBUG’, false );
      define( ‘WP_DEBUG_LOG’, false );
      4. Please post the contents of the file wp-content/debug.log through

  5. Abdul Wahab October 11, 2014 at 7:44 pm #

    How to use this [referrer_id] is not working and i dont know how to call it Affiliates_Service::get_referrer_id().

    • antonio October 12, 2014 at 10:11 am #

      If your need to use the shortcode:
      – In a Page/Post simply: [referrer_id]
      – In PHP code, you can use do_shortcode: echo do_shortcode( ‘[referrer_id]‘ );

      • Abdul Wahab October 12, 2014 at 10:49 am #

        but this code is not working showing blank space

        • antonio October 13, 2014 at 10:50 am #

          Be ware with copy-paste, be sure you are using the correct commas (‘)

  6. Jay August 26, 2014 at 2:26 pm #

    Hi just one more thing, when using affiliate the following shortcodes are not working


    Is this because it’s the standard version and not the pro version.

    • antonio August 27, 2014 at 7:59 am #

      yes, the advanced shortcodes are available in Pro and Enterprise versions.

  7. Jay August 26, 2014 at 12:51 pm #

    Also if I purchase Affiliates pro do I get gravity plugin and Social Share plugin included?

    • kento August 28, 2014 at 5:16 pm #

      No, these are separate.

  8. Jay August 26, 2014 at 12:42 pm #

    Hi I am testing the affliates standard before I purchase the pro version sometimes i will have to manually enter in orders taken over the phone and via enquiry forms, I tried to add a new referrals but when I press save it doesnt add the new referral have disabled all plugins.

    Any advice on what the problem could be


    • kento August 28, 2014 at 5:16 pm #

      Hi Jay, it might be because you try to record a referral that the system identifies as a duplicate of an existing one. Please try to use a unique Reference in the field available for that purpose.

  9. Drew August 12, 2014 at 7:23 am #

    Note: other shortcodes are working fine

  10. Drew August 12, 2014 at 7:22 am #


    When I use the shortcoe: [affiliates_login_redirect]

    It doesn’t show anything when I use internet Explorer 11..

    Its just blank where the login form should be.

    Its works fine from other browsers.

    Any idea how to fix this?

    • antonio August 12, 2014 at 2:52 pm #

      please give us an url to have a look.

      • Drew August 13, 2014 at 12:05 am #

        • antonio August 13, 2014 at 7:37 am #

          I have tested the website in IE 11.0.8 and I can see the page correctly.
          Probably it is a problem with your theme in your IE version. You could try to clear the browser cache.

  11. Jie July 2, 2014 at 5:03 pm #

    Hi Kento and team,

    I am running into issues with my login fields under my affiliate area. After entering the login credentials,I am automatically routed back to my main page and not into the affiliate’s detailed page (that shows performance,etc.) How would I go about fixing this? I am using Affiliates Pro, WooCommerce Integration, and Affiliates by Username.


    • antonio July 3, 2014 at 6:52 am #

      you can use [affiliates_login_redirect] shortcode in your affiliates-area page.

      • Jie July 3, 2014 at 10:05 am #

        Hi Antonio, I have LockerPress plugin installed to have a custom URL login to prevent my wp-login/wp-admin from getting attacked (which happened before) When I have the plugin turned off, everything works fine, but with the custom URL on, the [affiliates_login_redirect] shortcode does not work. What do you suggest? I don’t think I want to remove the Lockerpress, just want the shortcode to work alongside Lockerpress. Thank you!

        • kento July 6, 2014 at 11:50 am #

          Hi Jie,

          It seems that these are incompatible, but if LockerPress allows you to redirect to a page, you could use the [affiliates_is_affiliate] shortcode to offer a link to affiliates. Would that be an option?

          • Jie July 8, 2014 at 7:41 am #

            Sure, that would be an option. I tried to use this shortcode [affiliates_login_redirect]
            [affiliates_login_redirect redirect_url=""]

            previously too, but did not have success. I don’t mind not using lockerpress and can use an alternative plugin.

            Thanks again for the help!

  12. Juri April 18, 2014 at 9:43 am #

    Something more with multi tier integration i gues.
    So the affiliate gets commsion over an affiliate and that affiliate gets an commision to an the affiliate of the affiliate of the affiliate to. so its like multi level signup integration.

    Is that correct that it works like this with commision rate?

    • kento April 18, 2014 at 11:15 pm #

      For multiple tiers you would need Affiliates Enterprise, you can set rates per tier with that version.

  13. Juri April 15, 2014 at 8:39 pm #


    How can i earn the commission of the refferals refferal.
    Where can i find something like that or integrate that.

    So the affiliates get 5% earnings from the affiliate?

    Is there a way to fix this?
    I cant find it anywhere, sorry i am dutch!

    • kento April 18, 2014 at 9:01 am #

      Hi Juri,

      You can use the free Affiliates plugin with one of the free integrations for that. They allow you to set a commission rate and will record commissions on referred sales.

  14. khushi April 12, 2014 at 11:59 am #


    [referrer_user] is not working , want to show the name, username and email address of each referral, and whether they are Pending or Closed

  15. bucktastic April 9, 2014 at 5:59 pm #

    having same issue with no password showing up on registration page, but requires password when you sign up. also doesn’t show terms page and getting content not found error when you click on login or register buttons on the login screen…

    • antonio April 10, 2014 at 7:02 am #

      Affiliates uses WordPress registration system, so the password is sent by email.

  16. Nikole April 8, 2014 at 2:51 am #

    This doesn’t show the steps to upgrade … Can you please give the steps specifically? Do we just deactivate and install ? or is there more to it than that?
    I keep getting Failed message.
    Unpacking the package…

    Installing the plugin…

    Destination folder already exists. /home/snapfire/public_html/

    Plugin install failed.

    • antonio April 8, 2014 at 6:49 am #

      in your downloads page you have a README.txt file with the instructions.

  17. Nikole April 8, 2014 at 2:44 am #

    This doesn’t show the steps to upgrade … Can you please give the steps specifically? Do we just deactivate and install ? or is there more to it than that?

  18. Lorenzo March 22, 2014 at 11:35 pm #

    Hello. What is the process to make an upgrade from affiliate PRO to enterprise without losing existing data.

    Is there guide avaluable. if so please cna we have a link.

  19. Marko March 21, 2014 at 6:21 am #

    Hello! If I make update from pro to enterprise will all my data be saved. I mean will I lose all data that are stored in affiliate PRO if I upgrade. and one more question will cookie that are already stored in computers of potential clinets work with new upgrade.


    • antonio March 21, 2014 at 7:36 am #

      The data will not be lost, but
      1.- Always make a backup (files and database) before.
      2.- Be sure you have NOT selected “Delete all plugin data on deactivation” in Affiliates->Options.
      Cookies will work fine, if you don’t change “Affiliate URL parameter name” in Affiliates->Options.

  20. mark February 22, 2014 at 9:21 pm #

    Hi, I’m struggling to get my shortcodes to show correctly to the affiliate.

    I want basically to generate a banner link to a specific page for affiliates, but I can’t even get the basic shortcodes to work. I’m sure there is something that I’m not understanding, and that it isn’t the plugin 😉

    the pages are

    Affiliate sign up:

    and the links page, with the copied codes in, that don’t seem to work:

    any help or shortcodes appreciated please



    • mark February 23, 2014 at 1:44 am #

      i’ve been browsing around your site, and maybe the problem is that some shortcodes only work with pro? – I only have the basic plugin.

      But on your comparison page it does seem to say that a banner link to a specific page is possible …? Now I’m confused ….

      • kento February 23, 2014 at 11:34 am #

        Yes sure, you can use the [affiliates_url] shortcode for that, there is an example on the Shortcodes documentation page on how to use it with a link. To make it a banner, simply add an image inside.

  21. Toni Claren January 29, 2014 at 8:30 pm #


    For some reason my affiliate links are like this:

    Any idea why this is happening?

    • antonio January 30, 2014 at 8:17 am #

      That format is correct, what is the problem?

  22. RP January 28, 2014 at 5:12 pm #


    all my referrals are kept as direct.

    I access the site via and then access the contact page (at this time was the affiliate id lost?) to ask informations.

    The referral is kept always as direct.

    What can be wrong?


    • kento January 29, 2014 at 1:55 pm #

      The URL parameter is most probably wrong. The default is in the plural form affiliates and the URL you have posted is malformed. Check the documentation and generated affiliate area on how these are to be used please.

      • RP January 29, 2014 at 2:15 pm #

        Yes you´re right.. the url was mal formed. This is what i got from “Manage Affiliates” section:

        Yet, when I go to contacts page the url becomes

        is the affiliates info suppose to disappear fro the url? All referrals still go to direct.


        • kento January 29, 2014 at 2:41 pm #

          You seem to have a redirection in place. Also, if you have a page sitting at – then this will conflict with the URL parameter. In that case, change that page’s slug or the URL parameter to something different.

          • RP January 30, 2014 at 10:04 am #

            Hi, i have no page sitting at

            What is it about redirection? Some parameter I have to change?

            • kento February 1, 2014 at 11:20 am #

              Can we have access to the admin section of your site to have a look please? Create an account for support at itthinx dot com please and we’ll have a look.

          • RP January 30, 2014 at 10:15 am #

            If you mean the option Redirection, it is not checked.

            what can be wrong? Everything keeps going to direct.

            • kento February 1, 2014 at 11:21 am #

              Thanks, I don’t think that option is related in this case.

  23. Marko January 14, 2014 at 4:34 pm #

    hi i would like to know if there are shotrcodes that can display:

    1. Name of user that bought the product
    2. Name of the bought product

    I think that it is not dificult to for software to retreive these data, and in case that this function is not avaluable is there any way to include them.


    • antonio January 14, 2014 at 7:41 pm #

      please have a look to Affiliates Woocommerce Views plugin.

      • Marko February 13, 2014 at 9:20 pm #

        Thanks. But this is working id I want to insert the name of the product ordered, and I want to display name of the buyer; name surname name of the company etc. Is this possible.

        • antonio February 14, 2014 at 9:15 am #

          you can add in line 100, for example:

          $output .= "" . $order->user_id . "-" . $order->billing_company . "-" . $order->billing_first_name . "";


          • Marko February 15, 2014 at 2:24 am #

            I just wanted to complimet you for your fast answers and assistance.
            realy great service
            Thank You

            • antonio February 15, 2014 at 7:36 am #

              thanks 😉

  24. Martin December 8, 2013 at 6:16 pm #

    I would like to use affiliates shortcodes within this plugin:
    However they dont work. Also when using the “php echo do shortcode”-thing. The plugin’s author told me that the problem might be that affiliates plugin only supports Post Snippets’ shortcodes. Is that true?

    • antonio December 9, 2013 at 8:59 am #

      I suppose it’s true, if the author told you 😉
      If you need to add shortcode, this article may be useful.

  25. Jame Duffell November 25, 2013 at 3:09 pm #

    Hi kento,

    Is it possible to gain access to the forum, as I mentioned previously, I purchased the plugin direct from Jigoshop, which is a pain in the bum as I’m missing out on lots of resources from yourself.

    I purchased the “Affiliates Pro Integration Pack” direct and have my order details as confirmation.


    • antonio November 26, 2013 at 8:36 pm #

      you have access to Jigoshop forum support.
      Don’t worry, you can use our comments system or JigoShop’s support forum (they redirect us issues).

  26. James Duffell November 22, 2013 at 1:40 pm #

    Hi I have something which is driving me bonkers to work out. Rather than use affiliate URLs I’m looking at just using a shortcode.

    I can’t seem to figure out what the shortcode is to reference affiliate attributes, assuming this is really simple but could do with a pointer.


    • kento November 24, 2013 at 2:18 pm #

      Hi James,

      Do you mean with Affiliates or Pro/Enterprise? With the latter, you have this section in the documentation which explains how these can be rendered. Please post a topic in the forums if you need any help with that.


  27. Alex Joyner November 15, 2013 at 12:44 pm #

    Thank you for checking this out for me- much appreciated! Is there any chance of a paid integration pluggin for WP Members (like the one you have for S2 members) in the future?

    • antonio November 19, 2013 at 9:28 am #

      sorry, but currently there is in the planning. cheers

  28. Alex Joyner November 15, 2013 at 9:35 am #

    Here you go-

    Thank you so much!

    • antonio November 15, 2013 at 12:03 pm #

      I have tried this and seems that Affiliates is incompatible with WP Members, sorry.

      • antonio November 15, 2013 at 12:05 pm #

        Incompatible if you enable extra field, in other case no.

  29. Alex Joyner November 13, 2013 at 9:27 pm #

    Hi there,

    I have installed the plugin and set up an affiliate registration page but when I try to fill it in to test, it seems to clash with my WP Members plugin registration form, as it is asking for required fields from the Members registration form (which don’t even appear on the Affiliates form. Could you please help me sort this out?

    Thank you for you help!

    • antonio November 15, 2013 at 6:51 am #

      Hi,please give us an url to have a look.

  30. Bas Kasteel October 20, 2013 at 10:52 am #

    I would like to use the affiliate redirect shortcode and link the affiliate url to that. I tried the following but that does not work.
    It means nested shortcodes do not work. Can you think of any workaround ?
    [affiliates_login_redirect redirect_url=[affiliates_url]]

    • antonio October 21, 2013 at 9:26 am #

      you can not use shortcodes inside each other. If you want redirect to affiliate-area, you can use: [affiliates_login_redirect redirect_url=""]

  31. Mizan July 11, 2013 at 7:37 pm #

    How can Sell will be automatically added to an affiliate? I don’t have any ecommerce plugin setup.

    • antonio July 12, 2013 at 8:24 am #

      What e-commerce’re using? specific extensions exist for different e-commerce.

  32. Mike Sherratt May 14, 2013 at 10:30 pm #

    no your not understanding me I want the affiliates to be provided with there referrals details not there own details


    John brings lewis I want Lewis name and email to show to John on there affiliates area

    • kento May 15, 2013 at 12:00 pm #

      You can show referral stats using [affiliates_affiliate_stats] but with the s2 integration you will not be able to show what you have explained in the example.

  33. Mike Sherratt May 14, 2013 at 9:54 pm #

    will that show all affiliates there refferals names and emails not show there own


    • kento May 14, 2013 at 10:00 pm #

      Give it a try on a test page and visit it logged in as an affiliate, you’ll see the info presented by default. You can then fine-tune it using the attributes for the shortcode.

  34. Mike Sherratt May 14, 2013 at 5:19 pm #

    I want to know what the shortcode would be for me to show the affiliates details to the affiliate like in a table that gives them there name and email


    Mike Sherratt

  35. shachi April 17, 2013 at 10:57 am #

    ok thanks guys but i dont have affiliates pro so its not working anyway thanks for prompt reply ..

  36. shachi April 17, 2013 at 5:19 am #

    Hi, I need to display list of referrals in frontend is there any shortcode for that?

    • kento April 17, 2013 at 9:02 am #

      Please refer to the Shortcodes section in the documentation for that.

    • antonio April 17, 2013 at 10:45 am #

      It’s the [affiliates_affiliate_stats] shortcode.

  37. vermico February 19, 2013 at 6:02 pm #

    I want to require affiliates to provide their website on signup. Currently it is not required just suggested. I need to be able to see the website when I manage the affiliates. Can you tell me how to do this please?

    • kento February 20, 2013 at 1:31 pm #

      Hi, please have a look at this comment where a way to derive a customized form is outlined as well as an alternative providing your own form.

  38. Rob Gelhausen January 15, 2013 at 9:53 pm #

    I am using “Easy Contact Forms” plugin. How would I track a conversion when the visitor hits the/thank-you page?

    • kento January 17, 2013 at 11:17 am #

      The API documentation has a section on recording referrals, you can use it to capture the form submission event and record a referral based on the data.

  39. matteodini January 10, 2013 at 4:32 pm #


    it’s possible visualize a default value like “EUR 0,00” when the [affiliates_referrals show="total" status="accepted"] doesn’t have any earning by currency ?

    I tried but the shortcode doesn’t display any value.

    Thanks !

    • kento January 14, 2013 at 10:26 am #

      It’s not possible to do that, the shortcode is intended to show information based on existing referrals. But, it might be a good idea to add an option that shows some default text when the shortcode’s result would be empty.

  40. Alaina Frederick September 11, 2012 at 7:35 pm #

    I’m using this with Jigoshop and the store is actually at /shop. How do I get the affiliate short codes to link to my website with the /shop on it?

    • kento September 13, 2012 at 2:40 pm #

      This is explained in the Shortcodes section of the documentation.

  41. Nur August 22, 2012 at 11:02 am #

    Gravity forms allows inserting data into fields like this

    any idea how the code you shared might fit into an equation like that?

    • kento August 23, 2012 at 8:46 pm #

      Have you posted some code in the comment? If yes it’s been stripped off, please post in on pastebin for example and I’ll have a look.

  42. Nur August 21, 2012 at 4:20 pm #

    Is there any way I can include some code into a Hidden Field for Gravity Forms to allow me to track which affiliate the referral is coming from?

    • kento August 22, 2012 at 7:42 am #

      You can obtain the referrer ID by calling Affiliates_Service::get_referrer_id(). I’ve not used Gravity Forms but suppose it would be quite simple to use the value for the hidden field.

  43. dhaval July 26, 2012 at 9:31 am #

    i have not a recently a screen shot but i will send u….

    • kento July 26, 2012 at 9:45 am #

      Thanks, that will make it easier to help 🙂

  44. dhaval July 25, 2012 at 5:05 am #

    i put a registration affiliates form but i register new user than display error please enter password ? what i do for taht ?

    • kento July 25, 2012 at 5:43 pm #

      Does the email with the account details get through?

      • dhaval July 26, 2012 at 3:47 am #

        yes than also it display error

        • kento July 26, 2012 at 9:05 am #

          Please provide a screenshot of the error you get.

  45. Trent June 25, 2012 at 11:37 pm #

    I’ve installed and activated this plugin but I don’t see where I would set up the affiliate commission percentage. Where could I set the default commission rate, say 20% per sale?

    • kento June 26, 2012 at 9:43 am #

      Install any of the free integrations available and you will have a section added to the Affiliates menu where you can set that.

  46. Max November 12, 2011 at 1:43 pm #

    Hey Kento,

    You can check out my dutch affiliates page on

    Three questions:
    1. Can I translate all the fields to a Dutch text?
    2. Can I personalize the e-mail my affiliates receive? I would like it to include a thank you message and their personal affiliates code.
    3. Will this url not interfere with the plugin?

    I just used the shortcode without any options. I will probably add those later.

    • kento November 12, 2011 at 2:31 pm #

      Hi Max,
      1 – Sure, this just needs a translation file to be added. If you know how to handle .po files I’ll forward a template or you can send me the fields’ translations.
      2 – Not yet, that might get added to a coming release though. Features get added as contributors help or if general interest is sufficient.
      3 – No the URL should not interfere.
      Hey the Xmas balls are a nice idea 🙂

      • Max November 12, 2011 at 3:47 pm #

        Hey Kento,

        Thanks for the reply.

        1. Can you send me the .po files? I have never done it, but I am sure I’ll figure it out and it will be nice to learn.
        2. I will make a template for the page where affiliates are send to and send the e-mail from there. Can I access Post or get variables on that page?
        3. Thought.

        And thank you. We sold 50 already and the dutch december spirit has started today, so I am hoping for a big success.

        • kento November 12, 2011 at 4:09 pm #

          Thanks Max for contributing with your translations.
          Take a look at class-affiliates-registration.php, you should be able to derive what you need from there for the template.
          Fingers crossed for Xmas sales 😉

  47. Jayson October 28, 2011 at 9:47 pm #

    Hi where can I find documentation on the extended shortcodes for the pro version?

    • kento October 28, 2011 at 10:19 pm #

      I’ve just forwarded an outline to you while full doc is prepared. Thanks a lot for your support 🙂

  48. hayley October 26, 2011 at 3:52 am #

    Registration is currently do i fix this?

    • kento October 26, 2011 at 7:16 am #

      You need to allow people to register on your site: Go to Settings > General and tick Membership [x] Anyone can register

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account