# Turn Your Top Referrers Into Affiliates

> Finds the RewardsWP members who refer the most friends, checks who is not in AffiliateWP yet, and makes the ones you pick affiliates who earn commission.

- Job: [Affiliates & loyalty](https://storeagent.ai/mcp-recipes/job/affiliates/)
- What it does: Asks first: changes your store, only after you say yes
- Time saved: ~40 min vs doing it by hand
- Requires: StoreAgent (free plugin, MCP on every plan) + RewardsWP + AffiliateWP
- Works in: Claude, ChatGPT, Cursor and any MCP client connected to the store through StoreAgent MCP
- Web page: https://storeagent.ai/mcp-recipes/loyalty-referrers-to-affiliates/

## The prompt

```text
Rank my RewardsWP members by completed referrals over the last 6 months and show me the top 15. Check AffiliateWP and remove anyone who is already an affiliate. For the rest, show their referrals and points balance, and write a short note inviting them to earn commission on top of their points. When I approve someone, add them as an active affiliate in AffiliateWP with my default rate and send the welcome email.
```

## What happens when you paste it

You: Rank my RewardsWP members by completed referrals over the last 6 months and show me the top 15…

Assistant: 12 members completed 3 or more referrals in the last 6 months. 2 are already affiliates. Priya Shah leads with 9 referrals and 4,200 points. Calling: `rewardswp/list-top-members`, `affiliatewp/list-affiliates`, `affiliatewp/add-affiliate`.

Assistant: This will make changes in WooCommerce. Do you want me to go ahead?

Assistant: You approved 6 members. They are now active affiliates in AffiliateWP and each got the welcome email with their referral link.

## Abilities this recipe calls

- **List top members** (`rewardswp/list-top-members`, read only, from RewardsWP): Ranks members by points earned or completed referrals for a period.
- **List affiliates** (`affiliatewp/list-affiliates`, read only, from AffiliateWP): Lists affiliates with status, rate, group, earnings and referral counts. Filters by status, name, email or date.
- **Add an affiliate** (`affiliatewp/add-affiliate`, asks first, from AffiliateWP): Registers a user as an affiliate, or creates the user from an email address first.

## Variations

Add one of these to the end of the prompt. Swap anything in [brackets] for your own details.

- Look at the last 12 months instead.
- Put them in my Ambassadors affiliate group.

## Related recipes

- [Loyalty Program Health Check](https://storeagent.ai/mcp-recipes/loyalty-health-check.md): Tells you if your points program is working: how many points are redeemed, what it costs you and where points come from. Needs Advanced Loyalty Program.
- [Save Loyalty Points Before They Expire](https://storeagent.ai/mcp-recipes/save-expiring-points.md): Finds customers about to lose their points and gives them a small bonus that keeps their account active. Needs Advanced Loyalty Program.
- [Reward Your Top Loyalty Members](https://storeagent.ai/mcp-recipes/reward-top-loyalty-members.md): Ranks your most loyal customers by points earned and gives them a bonus as a thank you. Needs Advanced Loyalty Program.

---

Part of the StoreAgent WooCommerce MCP Recipes directory: https://storeagent.ai/mcp-recipes/ (index for LLMs: https://storeagent.ai/mcp-recipes/llms.txt). Get StoreAgent free: https://app.storeagent.ai/sign-up/
