Example (spam post containing an amazon affiliate link, post hopefully deleted by now but I assume mods/admins can see it): https://lemmy.world/post/15846936
Also there are tons of links people post legitimately but have tracking parameters, gclid=this, fbclid=that, etc. Those can be cleaned up too.
By editing out these parameters automatically when the link is posted, people’s privacy can be protected and the incentive to post affiliate spam can be decreased.
It could be a server config parameter and/or put into the posting UI: “your post contains [link] with flagged parameters, choose between a) post cleaned up version (shown), or b) post link without changes (may go into moderation queue depending on community settings).”
Keep in mind that this is the Lemmy.World support community, not Lemmy in general, so this post may not be seen by Lemmy devs.
If this was implemented, I doubt it would make it as a core Lemmy feature. This would like have to be built into either clients/interfaces (obviously each one would have to do this one their own), or it would probably have to be built on top of the planned upcoming plugin system.