Virus spreading problems in wireless rechargeable sensor networks (WSNs) are becoming a hot topic, and the problem has been studied and discussed in recent years. Many epidemic spreading models have been introduced for revealing how a virus spreads and how a virus is suppressed. However, most of them assumed the sensors are not rechargeable sensors. In addition, most of existing works do not consider virus mutation problems. This paper proposes a novel epidemic model, including susceptible, infected, variant, low-energy and dead states, which considers the rechargeable sensors and the virus mutation factor. The stability of the proposed model is first analyzed by adopting the characteristic equation and constructing Lyapunov functions methods. Then, an optimal control problem is formulated to control the virus spread and decrease the cost of the networks by applying Pontryagin’s maximum principle. Finally, all of the theoretical results are confirmed by numerical simulation.