I am dealing with old hacked sites in Wordpress where there are injection spam links on images. Also, need this for standard html sites.
I have access to the database and would like to remove links that look like this:
<a style="text-decoration:none" href="/ansaid-retail-cost">.</a>
Now the link varies inside the href and it might be for
cialas or any product, but the rest doesn't vary. I want to remove the
entire LINK, so the result is a single space.
I don't know regex, so I would appreciate the help. I've tried online regex generators but they don't seem to be working.
In this case, the html link is attached to an image caption in the database. However, finding that type of string in the database is what I need to replace by removing it entirely. If I find and replace just the source code <a style="text-decoration:none" href=" portion it will leave a lot of empty tags or erase things I don't want it to.
TIA,
Jeff
<a style="text-decoration:none; color: #f9f9f9;" href="http://alwaysvaltrexonline.com">buy valtrex online</a>
<a style="text-decoration:none[^”]*" href=“[^”]*”>[^”]*<\/a>
Thank you GP That worked very well for 80 links, but i found another set of links masked by making the text invisible in the posts...<a style="text-decoration:none; color: #f9f9f9;" href="http://alwaysvaltrexonline.com">buy valtrex online</a>There are 3 variations... the addition of colons in the style, and the addition of the color# and instead of using a single period to disguise it, they have put in full text in the linkI tried to modify what you did but nothing I did seemed to work.This is the closest to what you did I thought: I thought that this set of characters would find any text: [^”]* So i added it where the strings were for color and link text, but it did not find these type of strings:
<a style="text-decoration:none[^”]*" href=“[^”]*”>[^”]*<\/a>Can you tell me what I did wrong? And are spaces ignored in the string?