Fundamentally, there is no means of actually forcing good behavior on the internet at scale.
Since it's not going away and can't be prevented, the best defense is to take down the actually illegal content and otherwise allow anyone to post whatever they want while using neutral and unchanging...