I want to MURDER all the hyperlinks in a spreadsheet!

I tried following Google AI “instructions” for removing all hyperlinks in a spreadsheet, but it didn’t. All it did was remove all formatting…and left the hyperlinks still very much alive.

I want my spreadsheet to ignore email addresses and anything that even remotely resembles a hyperlink. This spreadsheet is meant to store purely enriched text data; no calculations or navigations are to be performed. How do I get calc to “understand” that? All I want to enter, copy, and paste is TEXT data.

Using LibreOffice 25.2.2.2 & Windows 11 x64 Home 22H2 (10.0.26100.3915)

Wanderer led me to the solution in thje provided link: Tools> AutoCorrect Options> Turn off URL recognition

Some things that will be helpful are your Operating System and LibreOffice Version all four digits. I.e. 25.2.2 for example.

1 Like

Copy the cells having hyperlinks.
Paste-special values only.

Here’s a great post by @Lupp on this topic.
Since the bug tdf#66694 is not fixed today, here’s a modified version of @Lupp 's macro that removes hyperlinks while preserving other formatting within the cells.

Sub RemoveHyperlinks(Optional oRanges)
  Dim oCell As Object, oPar As Object, oTextPortion As Object, bCont As Boolean
  If IsMissing(oRanges) Then  oRanges = ThisComponent.CurrentSelection
  oRanges = oRanges.queryContentCells(4 + 256)   ' values + formatting within parts of the cell
  For Each oCell In oRanges.Cells
    bCont = True
    Do While bCont 
      bCont = False
      For Each oPar In oCell
        For Each oTextPortion In oPar
          If oTextPortion.TextPortionType="TextField" Then
            If oTextPortion.TextField.supportsService("com.sun.star.text.textfield.URL") Then
              oTextPortion.setstring oTextPortion.TextField.Representation
              bCont=True
              Exit For
            End If
          End If
        Next oTextPortion
      Next oPar
    Loop  
  Next oCell
End Sub  
1 Like

Set your columns to be formatted as Text and switch off autocorrect entirely or only url-recognition.

https://help.libreoffice.org/latest/en-ZA/text/shared/01/06040100.html

LibreOffice 25.2.2.2 & Windows 11 x64 Home 22H2 (10.0.26100.3915)

You are a lifesaver. I feel so silly not having to think that I could turn off UR: recognition in Tools. Now, beside not opening a browser anymore, the text doesn’t change, stays the same. I started using spreadsheets before Excel was released, started on Lotus 1-2-3. Began using Excel in 1984, but I’ve been using open-source suites only for…I dunno, maybe fifteen years? But, I am totally new to LibreOffice, got fed up with the Apache garbage.

Thank you so much, Wanderer.

…but, how does unformatted text still not get recognized as a URL…unless recognition is turned off? Default font is same as Arial or whatever when calc sees an address.