Search code examples
htmlcsshref

Delete all hyperlinks in HTML


In my iOS app, I'm using some offline HTML's, but with a lot of links. Because the links are really distracting, I would like to remove them all.

<a href="https://www.admin.ch/opc/de/classified-compilation/19995395/index.html#ani1"><strong>Präambel</strong></a>

I first tried with Find and Replace <a href=" but then the URL is still shown. Every URL is different so I can't include that in find and replace..

Does anyone have an idea how I might be able to Find and Replace <a href="x"> where x can be any text? Or any tool to simply remove them all?

Thank you very much. Your help is really appreciated!


Solution

  • If the client doesn't like the blue underlining of links (per your comment to karlo's answer), just reset them using CSS:

    a {
        color: #000; /* or whatever colour you prefer - you may also use inherit */
        text-decoration: none;
        pointer-events: none;
    }
    

    Notice that we use pointer-events to remove any bound click events on the links (thus preventing them from being clicked by the user).

    jsFiddle Demo