I think OP is talking about how popular social media apps convert URLs you've posted into shortURLs.
The only way to save yourself from that attack is to make sure the social media app doesn't recognise the URL. URLs that are recognised get substituted with shortURLs.
2
How to prevent link hijacking on sites like Facebook, Reddit and Twitter? · c/TechTonic | Spyke
In terms of programming?
I think OP is talking about how popular social media apps convert URLs you've posted into shortURLs.
The only way to save yourself from that attack is to make sure the social media app doesn't recognise the URL. URLs that are recognised get substituted with shortURLs.