Loyalty Program for WooCommerce ships with one reward button per social platform: Facebook, Twitter, Instagram, and TikTok. If your brand runs two Instagram accounts, or you want to add a custom action that is not in the default list, you can add an extra button to the Earn Points page with a short snippet and a template override.
How Reward Actions Work
Earning actions are stored under the wpgens_loyalty_points_earning_actions option. The Earn Points template iterates over them and renders each as a clickable row. When a customer clicks a social row, the bundled frontend script sends an AJAX request to the plugin, which looks the action up by its type, awards the configured points, and marks it complete so it cannot be claimed again.
Adding a new button takes two pieces:
- Register the new action in the earning_actions option using the
option_filter, so the AJAX handler knows about it and the template iterates over it. - Override the
points-earn.phptemplate in your theme to map your new action type to a clickable URL.
Step 1: Register the New Action
Use the WordPress option_ filter to append a new entry to the earning actions list every time it is read. The snippet checks for duplicates so it is safe to run on every page load.
<?php
/**
* Register a second Instagram follow action for the loyalty program.
* Drop into wp-content/mu-plugins/ or your child theme functions.php.
*/
add_filter('option_wpgens_loyalty_points_earning_actions', 'wpgl_register_second_instagram');
function wpgl_register_second_instagram($actions)
{
if (!is_array($actions)) {
$actions = [];
}
foreach ($actions as $a) {
if (!empty($a['type']) && $a['type'] === 'INSTAGRAM_LIKE_2') {
return $actions;
}
}
$actions[] = [
'type' => 'INSTAGRAM_LIKE_2',
'title' => 'Follow our second Instagram',
'points' => 25,
'enabled' => true,
];
return $actions;
}
Step 2: Override the Template
Copy wp-content/plugins/wpgens-loyalty-program/templates/points-earn.php to wp-content/themes/your-theme/wpgens-loyalty/points-earn.php, then add a new case inside the social URL switch to point your new action at the right URL. The plugin automatically uses your theme copy when present (see the linked template override guide).
<?php
// Inside your theme override at yourtheme/wpgens-loyalty/points-earn.php
// Inside the switch ($action['type']) that resolves $clickable_url, add:
case 'INSTAGRAM_LIKE_2':
$clickable_url = 'https://www.instagram.com/your-second-account/';
$is_social_action = true;
break;
Make sure the case string matches the type you registered in step 1 exactly. The frontend JS uses the action type to build its AJAX payload, and a typo there is the most common reason clicks fail to award points.
Testing
Visit the Earn Points page as a logged-in user. You should see your new row with the configured title and points value. Click it: the link opens in a new tab, the AJAX request fires, points are awarded, and the row gets the green check icon. Refresh the page; the row remains marked as completed.