0

i want to replace all links with plain text. So

<a href="http://www.anydomain.com/2">anchor text</a>

should be just

anchor text

So I tried regex and it works here https://regex101.com/r/4q4nPf/1 but not in the plugin i used I tried this plugin https://wordpress.org/plugins/search-regex/

Screenshot of Plugin

any idea how i can do this?

Update: just use

/<a[^>]*>(.*?)<\/a>/
  • Did you try adding a delimiter around your regex pattern? That's what the little note on the bottom of your screenshot says. So for instance, /<a[^>]*>(.*?)<\/a>/ , noting the added slashes. (Since this is replacing stuff in your database, let me say, use at your own risk.) – tmdesigned Feb 21 at 22:45
1

Moving comment to answer:

Did you try adding a delimiter around your regex pattern? That's what the little note on the bottom of your screenshot says. So for instance, /]>(.?)</a>/ , noting the added slashes. (Since this is replacing stuff in your database, let me say, use at your own risk.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.