I need shortcodes for affiliate plugin

I have selected the affiliate plugin for my wordpress site and want to know how to add members for that. I mean a shortcode which allows user to send a request for affiliate program. and also please explain the flow...how can i send my banners to registered users to make it work.

Thanks and Regards,

  • Alexander

    Hi @john,

    Affiliates doesn't have any shortcodes, or do anything from the front end of the site. I would recommend that you create an affiliates page on your site with some basic information about what you're offering them.

    Then inform them that they must create a user account on your site. Finally, include a link to the affiliates page in the dashboard. You can just go there yourself and copy/paste to get the URL. This is the area where they'll be managing everything, and getting banners.

    You can find more instructions for this plugin here: https://premium.wpmudev.org/project/wordpress-mu-affiliate/#usage

    To setup the banners, just upload your banner images to the media library, then copy and paste the image URLs into the banner settings text area (one per line.) Then the Affiliates plugin can generate the banner codes including affiliate URL for the users.

    Best regards,

    • Paul Stevens

      In: plugins/affiliate/affiliateincludes/classes/affiliateshortcodes.php
      Find: function initialise() {
      Around line: 66
      Add this after that line:
      add_shortcode('affiliatelink', array(&$this, 'do_affiliatelink_shortcode') );

      Find: function do_affiliatelogincheck_shortcode($atts, $content = null, $code = "") {
      Around line: 121
      Add this before that line:

      //Add affiliate link shortcode function
      	function do_affiliatelink_shortcode() {
      		$user = wp_get_current_user();
      		$user_ID = $user->ID;
      		if(empty($user_ID)) {
      			return '';
      		$reference = get_user_meta($user_ID, 'affiliate_reference', true);
      		$siteurl = aff_get_option('home');
      		$affiliatelink = $siteurl.sprintf('/?ref=%s', $reference);
      		return $affiliatelink;


  • Patrick

    Hi @john

    Welcome to the forums, glad to have you aboard!

    Actually, the information provided by @Alexander Rohmann is, for the most part, correct.

    However, the Affiliates plugin does have several shortcodes that can be used to output affiliate data on the front-end of your site.

    You'll find all the shortcodes at the bottom of the plugin usage page here:

    For example, place the following shortcodes on any page on your site to mirror the affiliate info that appears in the wp-admin user profile area, and give your users an easy place to copy the banners that you make available to them (note that you must still enter the banners yourself in the wp-admin):