If this headline’s claim were true, why would it apply just to violence and not all experiences? Wouldn’t it imply that all kinds of activities alter genes? For example if you play sports, you might get one type of change and if you were a lawyer, you might get another kind of change and so on.
You should read the actual article, which provides necessary context and nuance, and not just the headline. The article is specifically discussing the effect of stressors caused by trauma (violence) on the transmission of genes from mother to child. The effect discussed does not generalize to all experiences.