This changes the random key used for newly generated referral coupons. Existing coupons are not regenerated automatically.
Developer note:
Add custom PHP in a small custom plugin or child theme, and test it on a staging site before production. This example requires ongoing maintenance when extension APIs change.
functions.php
<?php
add_filter( 'automatewoo/referrals/coupon_key_length', 'my_store_referral_coupon_key_length' );
/**
* Set the referral coupon key length.
*
* @return int
*/
function my_store_referral_coupon_key_length() {
return 8;
}