We study the incentive of an ad‐funded social media platform to curb the presence of unsafe content that entails reputational risk to advertisers. We identify conditions for the platform not to moderate unsafe content and demonstrate how the optimal moderation policy depends on the risk the advertisers face. The platform is likely to undermoderate unsafe content relative to the socially desirable level when both advertisers and users have congruent preferences for unsafe content and to overmoderate unsafe content when advertisers have conflicting preferences for unsafe content. Finally, to mitigate negative externalities generated by unsafe content, we study the implications of a policy that mandates binding content moderation to online platforms and how the introduction of taxes on social media activity and social media platform competition can distort the platform's moderation strategies.