The rapid development and popularization of mobile internet technology have changed the way information is obtained and communicated. Various social media and e-commerce websites have emerged one after another, providing convenience for the public to participate in online comments and creating a good communication environment for Internet Word of Mouth (IWOM). Social networks are either a brand new internet application, a revolutionary way of information exchange, or a disruptive business model, but they are also a powerful booster for integrating the virtual world of the internet with the real world of humanity. Word of mouth (WOM) communication on social media has the characteristics of anonymity, fast communication efficiency, and rich communication forms, as it is utilized by many enterprises as a marketing model with low investment and high returns. Using social media platforms for word-of-mouth marketing (WoM) has advantages that traditional marketing models cannot match, but it also brings challenges to enterprises. This article constructs an optimization model for e-commerce WoM strategy based on social media and demonstrates the existence of the optimal solution. Analyzed the advantages of using social media for WoM and provided relevant marketing strategies, hoping to provide reference for relevant researchers.