Remove All Hyperlinks in Word or Excel

Contributor Icon Contributed by katy8439  
Tag Icon Tagged: Microsoft Office  

These two nifty macros enable you to delete the embedded hyperlinks that are generated when typing URLS or copying information from the web.


Ever copy and paste something from the Internet and then into Word only to get the hyperlinks embedded? You can removed them easily with the Macros below.

Word

Hit [ALT]+[F11] to open the Visual Basic Editor

Go to “Insert” > “Module” and in the pop-up window copy:

Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Then click “File” > Close and return to Microsoft Word

You can now run the Macro in Word by going to:

Tools > Macro > Macro and then Run “RemoveAllHyperlinks”

Excel:

You can do the same in an Excel Document:

Hit [ALT]+[F11] to open the Visual Basic Editor

Go to “Insert” > “Module” and in the pop-up window copy:

Sub RemoveHyperlinks()
'Remove all hyperlinks from the active sheet
ActiveSheet.Hyperlinks.Delete
End Sub

Then click “File” > Close and return to Microsoft Excel

You can now run the Macro in Excel by going to:

Tools > Macro > Macro and then Run “RemoveAllHyperlinks”, this will delete all URLS on the selected worksheet.

 

147 Comments -


  1. Anonymous said on October 19, 2008

    Very good.
    Have been attempting to find a solution for some time.
    This macro cleared all links in a very large file at the first attempt.
    Dehkay

  2. fhff said on October 28, 2008

    Awesome!!!!!!! saved me so much time lol thanks

  3. James said on October 29, 2008

    very nice! thanks for the tip!

  4. Scott said on November 4, 2008

    THANK YOU! 1 Million ties thank you!!

  5. Umer said on November 5, 2008

    Awesome work, after learning such thing, I feel like a geek ;-)

  6. Student said on November 6, 2008

    Select the entire block of text, then press Ctrl-Shift-F9. Presto: No more hyperlinks. In their place, plain text.

  7. Will said on November 10, 2008

    Wow, very helpful! Thank you!

  8. gurinder said on November 11, 2008

    thanks …

    very very nice.. was so easy with your help

    gurinder singh

  9. agun said on December 4, 2008

    owo great …. thank u …

  10. Shivshanker Cheral said on December 4, 2008

    Also by presssing Ctrl + 6 we can do this!

  11. Shivshanker Cheral said on December 4, 2008

    you can remove hyperlink using Ctrl+6 also

  12. Nishant said on December 7, 2008

    Hey
    I ran the above macro during a term paper that i was working on, in MS Word 2007.
    Works great – removed all the hyperlinks….
    Thanks ALOT!!

  13. john said on December 17, 2008

    Very useful to me. Thank you so much :D :D

  14. Blandoo said on December 18, 2008

    Somehow this does not work for javascript embedded within a picture (buttons). Please let me know if there is a “Remove all Javascript” macro I can run.

    Thanks

  15. Rusty said on December 20, 2008

    Worked like a charm for removing all hyperlinks – thanks

  16. sil said on December 22, 2008

    Many Thanks for this help, Muchly appreciated

  17. me said on January 16, 2009

    ok.. it works… thanks a lot.. i’ve been loocking for this.. just not hard enough until now because i didn’t have that much text copied.. it actually took me 2 minutes to find this… and it’s great.. and u actually don’t need to know anything.. just follow the easy instructions

  18. shabi said on January 20, 2009

    it’s really very good

  19. Dan said on January 26, 2009

    In Office 07 for words. The macro section is under the “view tab” to the far right.

  20. orpheus said on February 12, 2009

    Thank you very much. It’s very useful.

  21. tabi said on February 19, 2009

    This didn’t work for me…maybe a problem with Excel 2007? Or my stupidity, it’s tough to say.

  22. CasuaL said on March 15, 2009

    Great work, thanks a lot :)

  23. Bob said on March 28, 2009

    Excellent – saved me having to remove 700+ hyperlinks by hand.
    Super huge thanks

  24. Sridhar said on April 11, 2009

    Marvellous

  25. Jason said on April 17, 2009

    Damn Nice!
    Thank you so much.

  26. sasikanth said on April 21, 2009

    it nice it working thanks

  27. Najen said on April 22, 2009

    Hi here is code to remove all shapes which include objects ActiveX controls (Control Toolbox) or a linked or embedded OLE objects,Controls from the Forms toolbar
    ,Controls from the Drawing toolbar,Pictures, chartsactive x,buttons,pcitures,drop down lists etc.It will basically remove all these objectsActiveX controls. even cell comments but not cell comments

    Code:

    Sub Shapes1()
    ‘Delete all Objects except Comments
    On Error Resume Next
    ActiveSheet.DrawingObjects.Visible = True
    ActiveSheet.DrawingObjects.Delete
    On Error GoTo 0
    End Sub

  28. prasad said on April 23, 2009

    very very very very very thanks

  29. Johnny said on May 1, 2009

    Thank you very much.
    Made my life a whole lot easier. =D

  30. Anji said on May 5, 2009

    THANKS that’s great! Saved me precious time. Worked on my mac too.

  31. k said on May 12, 2009

    gr8! saves me a lot of time.

  32. Andy McDandy said on May 27, 2009

    Thanks a lot..great help

  33. Prashanth said on June 15, 2009

    just copy to notepad and paste it back!

  34. adam said on June 16, 2009

    I have been ALWAYS looking for this.

    Didn’t know I’d ever FIND it, just by googling. Congrats. GREAT CODE!

  35. ivica said on July 1, 2009

    TNX

  36. nox13666 said on July 10, 2009

    Thanks, this worked

  37. Anonymous said on July 20, 2009

    how to enable hyperlink, after removing it using VB..?

  38. Kevin said on August 16, 2009

    Thank you for your help. This is a command that Microsoft clearly forgot to add. Great job! Although I have written plenty of macros (mostly on Excel, but a few in Word), I was not excited about adding to my already large set of macros… but I’m glad that I did. It works perfectly!

    Thanks

  39. Heather Arndt Anderson said on August 27, 2009

    God, thank you! This is so clean and direct, without entering a bunch of dummy data to sidestep the problem. Thank you so much.

  40. ADTC said on September 9, 2009

    There’s another tip that says to select all text and clear formatting. But this makes it lose formatting.

    I found yet another way, just select some normal text in the paragraph and click the Format Painter. Then select all the text where you want hyperlinks removed. The text retains most of the formatting (except when it disagrees with the original text selected before clicking Format Painter).

  41. Vanessa said on September 16, 2009

    OMFG thx u! it works! i am soooo hppy! :D

  42. Anonymous said on October 6, 2009

    Adding another thank you to the list!

  43. Anonymous said on October 7, 2009

    Very Very Thanks

  44. Anonymous said on October 7, 2009

    yes its also working good
    thanks dear

  45. Anonymous said on October 7, 2009

    i need macro programs pls send your macros what u have.
    tks

  46. Jay said on November 3, 2009

    Thank You, this worked like a dream.

  47. Anonymous said on November 10, 2009

    dude whoever you are
    u rock
    this is excellant

  48. me said on November 14, 2009

    cool. never used a macro before :)

  49. Si said on November 18, 2009

    THANKS! This was really handy when pasting Wikipedia articles into Word

  50. Pirnima said on November 25, 2009

    Thank You So much .. my file size has been reduced by half… Thank you really I have been looking for a solution since 3 years!!

    Is there a way where you can can keep the hyperlinks in one column that you want .. and remove it from the rest of the sheet?

  51. ADTC said on November 25, 2009

    That’s strange. How do hyperlinks make your file two times bigger? Anyway to selectively remove hyperlinks, I posted the following in a previous comment (2 months ago) for Word:

    —-
    There’s another tip that says to select all text and clear formatting. But this makes it lose formatting.

    I found yet another way, just select some normal text in the paragraph and click the Format Painter. Then select all the text where you want hyperlinks removed. The text retains most of the formatting (except when it disagrees with the original text selected before clicking Format Painter).
    —-

    As for Excel, you can try the second way there too! Just select a cell with normal text, then click (or double-click if you want to do multiple times) the Format Painter, then select the columns with hyperlink that you want removed. Remember that all the selected columns will have the same formatting as the original cell you selected.

    Well apparently I discovered that in both Word and Excel, it doesn’t actually remove the hyperlink but only make the formatting of the link similar to the normal text you selected. This means the links no longer look like links anymore (it looks like normal text now), but when you click on it, it still launches your browser to navigate to the link address.

  52. Anonymous said on December 18, 2009

    Thanks for the help. It helped me & saved my time.

  53. Humza Bobat said on December 28, 2009

    Very Useful Stuff :-)

  54. Anonymous said on December 30, 2009

    i don’t know delete hyperlink in Microsoft Office Word 2003

  55. Anonymous said on January 3, 2010

    I just wanted to ad something if one wants to use the same with Office 2007 or later.
    The procedure is just the same but in order to execute it we need to click on office button, then change the Popular Commands Drop Box to Macros.
    Click on the remove…..
    Add>
    Done!

  56. Anonymous said on January 4, 2010

    Or…select all the text and press CONTROL+6

  57. Tom said on January 15, 2010

    Thanks for the MS word solution. I couldn’t figure out how to get rid of those stupid hyperlinks. Very greatful.

  58. Tom said on January 15, 2010

    Thanks for the MS word solution. I couldn’t figure out how to get rid of those stupid hyperlinks. Very greatful.

  59. Anonymous said on January 18, 2010

    THANK YOU X 100000000000000000000000000000000000000000000. I had over a week long work load of deleting these and this did it in seconds!!!!!!!!!!

  60. Jim said on January 22, 2010

    My only question is, why isn’t this option in the program to begin with? Answer: Microsoft.

  61. A.D.E.Cyber Emporium said on February 4, 2010

    Thanks for the info.
    Saved heaps of time and was so easy to do.
    A+

  62. Research said on February 17, 2010

    In MS word

    select all [CTRL + A]
    then CONTROL + SHIFT + F9. …

    NO NEED FOR VBA… Simple and fun….

  63. Mike said on February 18, 2010

    Thanks worked great…..the first time, when i tried it a second time it went all grey, i couldnt paste the information into another word document or anything. A bit anoying :-(

  64. BentSpork said on February 25, 2010

    Great code, but it doesn’t go into the footnotes. here is code for footnotes using the Selection approach:

    ActiveWindow.ActivePane.View.SeekView = wdSeekFootnotes
    ‘ Select all text in the footnotes.
    Selection.WholeStory
    ‘ Loop through fields in selection.
    For Each aField In Selection.Fields
    ‘ If field type is a Hyperlink field.
    If aField.Type = wdFieldHyperlink Then
    aField.Unlink
    End If
    Next aField
    ‘ Close Footnotes and return to document
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

  65. adam page said on March 1, 2010

    Thanks for this :)

  66. Anonymous said on March 7, 2010

    thank you dost.

  67. VIKI said on March 18, 2010

    WOW REALLY GREAT TIP….. I WAS SEARCHIN FOR THIS TIP

  68. Anonymous said on March 30, 2010

    AWESOME !!!! You saved my whole day !!!

  69. Anonymous said on April 14, 2010

    It was awesome!! This perfectly works for me!! I have one doubt. Will this changes reflects in other system which doesnt have macros.

    Thanks,
    Krithika

  70. Laptop Repairs said on April 15, 2010

    That saved me like 4 hours of workload. Can’t tahk you more. Thanks a bunch~!

  71. Anonymous said on April 22, 2010

    Thank You…. works a treat

  72. ashley said on April 30, 2010

    I want it to not paste as a hyperlink in any document. I don’t want to have to remove them in each document.

    I know how to copy a #1 and hold control and select all the links I want to disable and paste special and choose multiply to make all links go away. Then I have to reformat the text to match surrounding text. (change from blue to black and remove underline)

  73. mickey said on May 4, 2010

    It’s a beautiful thing. Thanks so much…

  74. Anonymous said on May 6, 2010

    This helped me no end with a big problem I was having on some huge spreadsheets! Thank you very much

  75. Larry Orr said on May 13, 2010

    What versions of Work and Excel are you talking about? Are these Windows or Mac commands? In other words, more info is needed.

  76. samir said on May 24, 2010

    Hello Umer

  77. samir said on May 24, 2010

    Hello Umer

  78. nick said on May 25, 2010

    made my day, saved my ass, thanks

  79. Henri said on May 29, 2010

    Thank you

  80. Lune said on May 31, 2010

    Thanks a lot!

  81. Scott said on June 10, 2010

    Awesome – thanks!

  82. Umir said on June 18, 2010

    Hello Samir

    Umir

  83. Aakarsh said on June 21, 2010

    very gud post
    thnx for the information

  84. nora said on June 21, 2010

    Ctrl-Shift-F9!
    IT WORKS!
    Elegant simple and it works!
    THANK YOU STUDENT PERSON!!!

  85. Ishaan said on June 24, 2010

    One new IDEA!!!!!
    Press Ctrl+6
    And all the links will disapear in a second

  86. Ishaan said on June 24, 2010

    One More Ctrl+Shift+F9

  87. Irina Eastwood said on June 25, 2010

    Amazing! Very straight forward. Thanks guys! It worked

  88. Suzym27 said on July 2, 2010

    But how do I do this on a MAC?!?!

  89. Suzym27 said on July 2, 2010

    Figured it out!

    Control + A to select all
    Control + 6 to clear all hyperlinks

    Fantastic!

  90. Jhasgdas said on July 3, 2010

    thank you very much bro…

  91. Ambatirajaraviteja said on July 20, 2010

    superrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

  92. Juicylicious said on July 27, 2010

    Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you!!!!!!!!!

  93. Ajith Moharana said on July 29, 2010

    super class coder – a lot of thanks

  94. Clarkygal345 said on August 2, 2010

    For word, press CTRL + A to select all, then press CTRL, Shift + F9.
    Shortcut to get rid of all hyperlinks :)

  95. Futbolamanda said on August 4, 2010

    YAY you are SOOOOO helpful. Thanks heaps! Really, it is a revelation. I hated those hyperlinks!

  96. Guest said on August 4, 2010

    Click ‘file’ in Excel 2007??? Are you kidding me?

  97. dotaplayer said on August 9, 2010

    I love ya oh yes

  98. Veb_405 said on August 11, 2010

    this trick is so helpful to remove Hyperlinks with one click

    that`s awosome!!!!!!

  99. Liz said on August 13, 2010

    This is awesome. You rule. Thanks.

  100. mujnoo said on August 18, 2010

    You are FABULOUS!!!
    why is this solution not available in the Excel help????
    thank you so much.

  101. Powers_100 said on August 20, 2010

    with this I am unable to remove hyperlinks of Java Script

  102. Soanis said on August 20, 2010

    For Office for Mac its cmd + 6 (that’s the command button near the spacebar + 6) when a text is selected.

  103. Nana said on August 25, 2010

    Thank you so much!

  104. Bretv72 said on August 25, 2010

    Oh thank you, thank you. I have a weekly document that I used to spend an hour on just removing copied hyperlinks!

  105. S2c said on September 13, 2010

    or you could select the text and press control+shift+f9

  106. Prostreetphotography said on September 15, 2010

    WHERE are the Tools > Macro > Macro tabs? I don’t see them in any menu at the top of my Word document. I copied everything above into a macro, but can’t seem to find any of the tabs I need to click on after that. Help! This sounds like such a great idea if I can figure it out.

  107. Prostreetphotography said on September 15, 2010

    OMG! Thanks, S2c! YOUR trick worked instantly! I’ll have to remember that one!

  108. Harris David said on September 17, 2010

    Wahhh…good dude..this is what i searched a lot…thx

  109. D Arumugam said on September 22, 2010

    thanks for your help

  110. Vickythakre said on September 26, 2010

    Many Many Thanks buddy

  111. Jelena said on September 30, 2010

    Many thanks from Jelena N, Belgrade, Serbia

  112. Mrix2 said on October 4, 2010

    Thank you very much!!

  113. jeremey said on October 6, 2010

    EXCELLENT! THANK YOU SO MUCH!

  114. Dhas said on October 6, 2010

    How about pressing CTRL+A then CTRL+SHIFT+F9?

  115. R Andrew025 said on October 10, 2010

    ThankS alot!

  116. 123 said on October 24, 2010

    Good one

  117. ASHRAJ2204 said on October 24, 2010

    THANKX

  118. Joe said on October 26, 2010

    Thank You very much. It helps.

  119. Shashank TM said on October 27, 2010

    Thank you so much it helped me lot

  120. nebo said on November 13, 2010

    This works for MS Word for Mac – i.e. cmd+6. Thank you.

  121. Leo said on November 17, 2010

    Thanks, for a while i’ve been looking for something to remove hyperlinks in excel. I knew that CTRL+Shift+F9 removes them in word. Keep up the good work

  122. Neeraj Tiwari said on November 19, 2010

    there is no tools option in microsoft word 2010 .. i m stuck after copying the macro…please help….

  123. Nemanie Dem said on December 26, 2010

    Awesome! You saved my day)

  124. Nemanie Dem said on December 26, 2010

    Awesome! You saved my day)

  125. Mav786110 said on December 29, 2010

    amazing history project aced

  126. V P said on December 31, 2010

    outstading !!!!!!!!!!!!!!!!!!!!

  127. Ceci said on January 13, 2011

    same here! please!

  128. Dilpreet Singh said on January 25, 2011

    When i save the marco it works but is there any way it should remain saved in excel permanently…..whenever i open an excel file it should automatically be saved.

  129. Linknumbernine said on January 28, 2011

    you are an angel. I love you

  130. Spooky said on February 19, 2011

    Thanks dude! You saved me a lot of time so I didn’t have to remove every single hyperlink manually. I’m sue a lot of folks find this very helpful.

  131. Guset said on April 1, 2011

    Thanks! Very usefull.

  132. Imtiaz said on April 6, 2011

    thanks its working goood

  133. machimocho said on April 28, 2011

    excellent tip

  134. Equinepedestrian said on May 2, 2011

    This has proven to be very helpful!

  135. Anonymous said on June 9, 2011

    it works great …. but it doesn’t remove the links from images. Any ideas?

  136. JJ said on June 13, 2011

    I am also trying to remove links from images… :( not working, please help

  137. Anonymous said on June 15, 2011

    maybe save it in HTML and then remove the links then paste it into word again

  138. Caidian Johnson said on October 26, 2011

    … Thank you very much – Worked a treat! …

  139. Akhtar Jahan said on November 7, 2011

    Perfect. Thanks

  140. Cindy said on November 16, 2011

    THANK YOU – simple and fast.

  141. SRILAKSHMI said on November 21, 2011

    Thanks a lot. With this, I have removed all URL data within a few seconds in a very large excel file

  142. Akhtar said on November 22, 2011

    This article realy good.Special thanks to BentSpork. He solved my footnote hyperlink problem.

  143. sunwukong said on November 22, 2011

    I’m looking for a macro that will succesively find each hyperlink, copy that link and then place it in the document (after the linked text) as text.

  144. Marvin said on December 2, 2011

    Thank you so much! This is the greatest little gem I’ve found in a long time. At last, some real helpful help.

  145. Paul said on December 28, 2011

    Thanks – the other solutions online were not as quick or effective as this macro!

  146. Libor said on January 10, 2012

    Thanks! Smart solution.

  147. John said on January 31, 2012

    Many thanks – it’s excellent.

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -