My client has a custom unsubscribe page using cloud pages (Using CloudPgeURL function) in all emails. When a subscriber receives the email and forwards it to a friend, the friend is able to click on the unsubscribe link and unsubscribe which is recorded against the original subscriber. We would like to avoid this. Is there a way to inactivate a link for email forwards? Or any other way to avoid this?
Forwards are a general topic that you cannot stop from happening, as FTAF (a specific function served by SFMC) is not the only way to forward an email. In fact, it is probably a rare exception, if implemented. If an FTAF link is implemented, you can do something, see end of post.
Most people simply press "forward" in their email client (say, gmail), and since you have no access to the recipient side / client, there is nothing you can do to stop that. In fact, you won't even be able to track it or notice that it happens;
This gets even more problematic when you include links in your emails that surface data, as forwards are a "backdoor" of sorts how the wrong people could get access to this data on a preference center or similar.
The only way to block this unsubscription without the real user's consent would be a "double opt out" process where you send an email to the original inbox for the user to confirm that it was really them.
This raises a lot of other questions ("why do you make it so hard to unsubscribe"), so I am not sure it's something that can be recommended.
Definitely a dilemma, but the technical solutions are limited to the actual FTAF - Forward to a friend link / function, which comes with a HUGE gap (all of the above).
You can target that specific scenario using:
%%[ IF _messageContext != "FTAF" THEN ]%% <!--show link here--> %%[ ENDIF ]%%