Removing malicious code from posts
-
I have two WordPress blogs with about 3,700 posts each. Most if not all of the posts now have malicious code inserted into them. In the middle of each post is a set of SPAN tags containing rambling text about cialis and viagra. At the end of each post is a set of SCRIPT tags with a string of random code such as faf=”ne”;oa2=”9e”;c9d=”e”;x088=”no”;g3c7=”df”;t94=”j9″;s51=”d1″;hbe=”65″;document.getElementById(t94+s51+hbe+g3c7+oa2+c9d).style.display=x088+faf.
This code is almost always invisible to users but shows up in the WordPress Edit Post window. I know I will need to find and remove the malicious files that inserted the code, but my real question is how can I do a mass delete of all of this text that is between the span and script commands? The text is different in every post so I can’t just do a find and replace, and doing it by hand for each of 7,400 posts would be pretty tedious.
If anyone has encountered this malware and knows how to find and delete the infected files, I would appreciate knowing that as well. For what it’s worth, I have WordPress 6.0 installed and the latest version of all my plugins and themes.
The page I need help with: [log in to see the link]
- The topic ‘Removing malicious code from posts’ is closed to new replies.