0

I would like to delete certain link that I have in the content of all the entries, for example :

 <a href="https://www.sitio.com">link contenido</a>

Change it to:

link contenido

Or some way to do it from the database, some sentence sql

1

Your best bet is a 'search and replace' plugin that will fix things in the database. I like the "Better Search and Replace" plugin.

It has a 'test' mode so you can make sure that all is well. You would enter the first term in your question as the 'search', and the 2nd term as the 'replace'. Use the 'test' mode to make sure all is well.

Of course, back up your database first (and know how to restore it) before you do such a thing. Afterwards, disable the plugin (not necessary to remove it).

  • Hi, thanks, it did not work for me, not all the links have the same html format for example there are many such Appointment: <a href="sitio.com/site1"> others like that <a href="sitio.com/sitio2"> and so <a href = "https: // www .sitesite3 "> I mean almost all of them are different from each other, the only thing that is the same is the website: Appointment: www.sitio.com – juan Mar 2 at 11:07
  • You could try some Javascript to search the Dom for all <a> tags and remove the href. But that would affect all <a> tags in the page, so you would have to ensure that there is something unique about the <a> tags you want to remove, like a class name. It might be easier to change the template that creates the page to remove any generated <a> tags. – Rick Hellewell Mar 2 at 18:38

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.