Warning: Invalid argument supplied for foreach() in /home/techrecipes/public_html/wp-content/themes/techrecipes/header.php on line 77

Remove All Hyperlinks in Word or Excel

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


Have you ever copied and pasted 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 the following:

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 running RemoveHyperlinks.

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 running RemoveHyperlinks. This will delete all URLS on the selected worksheet.

The Conversation

Follow the reactions below and share your own thoughts.

  • Anonymous

    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

  • fhff

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

  • James

    very nice! thanks for the tip!

  • Scott

    THANK YOU! 1 Million ties thank you!!

  • Umer

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

    • samir

      Hello Umer

    • samir

      Hello Umer

      • Umir

        Hello Samir

        Umir

        • Junaid

          > It’s Very simple

          1 Copy the row

          2 Then Paste Special

          3 Then click values

          then all hyper link will gone …

          • Michael

            “then all hyper link will gone …”

            ALL previous formatting will also be gone using this method.

  • Student

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

    • Shivshanker Cheral

      Also by presssing Ctrl + 6 we can do this!

    • nora

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

  • Will

    Wow, very helpful! Thank you!

  • gurinder

    thanks …

    very very nice.. was so easy with your help

    gurinder singh

  • agun

    owo great …. thank u …

  • Shivshanker Cheral

    you can remove hyperlink using Ctrl+6 also

    • Powers_100

      with this I am unable to remove hyperlinks of Java Script

  • Nishant

    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!!

  • john

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

  • Blandoo

    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

    • Najen

      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

  • http://www.theplugg.com Rusty

    Worked like a charm for removing all hyperlinks – thanks

  • sil

    Many Thanks for this help, Muchly appreciated

  • me

    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

  • shabi

    it’s really very good

  • Dan

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

  • orpheus

    Thank you very much. It’s very useful.

  • tabi

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

  • CasuaL

    Great work, thanks a lot :)

  • Bob

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

    • Anuj Singhai

      Thank you very much. It’s very useful.

  • Sridhar

    Marvellous

  • Jason

    Damn Nice!
    Thank you so much.

  • sasikanth

    it nice it working thanks

  • prasad

    very very very very very thanks

  • Johnny

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

  • Anji

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

  • k

    gr8! saves me a lot of time.

  • Andy McDandy

    Thanks a lot..great help

  • Prashanth

    just copy to notepad and paste it back!

  • adam

    I have been ALWAYS looking for this.

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

  • ivica

    TNX

  • nox13666

    Thanks, this worked

  • Anonymous

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

  • Kevin

    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

    • Anonymous

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

  • http://voodooandsauce.com Heather Arndt Anderson

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

  • http://thehunk.blogspot.com ADTC

    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).

    • Anonymous

      yes its also working good
      thanks dear

  • Vanessa

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

  • Anonymous

    Adding another thank you to the list!

  • Anonymous

    Very Very Thanks

  • Jay

    Thank You, this worked like a dream.

  • Anonymous

    dude whoever you are
    u rock
    this is excellant

  • me

    cool. never used a macro before :)

  • Si

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

  • Pirnima

    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?

    • http://thehunk.blogspot.com ADTC

      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.

  • Anonymous

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

  • Humza Bobat

    Very Useful Stuff :-)

  • Anonymous

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

  • Anonymous

    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!

  • Anonymous

    Or…select all the text and press CONTROL+6

  • Tom

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

  • Tom

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

  • Anonymous

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

  • Jim

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

  • A.D.E.Cyber Emporium

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

  • Research

    In MS word

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

    NO NEED FOR VBA… Simple and fun….

  • Mike

    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 :-(

  • BentSpork

    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

  • adam page

    Thanks for this :)

  • Anonymous

    thank you dost.

  • VIKI

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

  • Anonymous

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

  • Anonymous

    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

  • http://www.webmax.ltd.uk Laptop Repairs

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

  • Anonymous

    Thank You…. works a treat

  • ashley

    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)

  • mickey

    It’s a beautiful thing. Thanks so much…

  • Anonymous

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

  • Larry Orr

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

  • nick

    made my day, saved my ass, thanks

    • Ambatirajaraviteja

      superrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

  • Henri

    Thank you

  • Lune

    Thanks a lot!

  • Scott

    Awesome – thanks!

  • Aakarsh

    very gud post
    thnx for the information

  • Ishaan

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

  • Ishaan

    One More Ctrl+Shift+F9

  • Irina Eastwood

    Amazing! Very straight forward. Thanks guys! It worked

  • Suzym27

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

    • Suzym27

      Figured it out!

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

      Fantastic!

  • Jhasgdas

    thank you very much bro…

  • Juicylicious

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

  • Ajith Moharana

    super class coder – a lot of thanks

  • Clarkygal345

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

  • Futbolamanda

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

  • Guest

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

  • dotaplayer

    I love ya oh yes

  • Veb_405

    this trick is so helpful to remove Hyperlinks with one click

    that`s awosome!!!!!!

  • Liz

    This is awesome. You rule. Thanks.

  • mujnoo

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

  • Soanis

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

    • nebo

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

  • http://pulse.yahoo.com/_7IQW4CITWBTCG3XFRWAUD6EHEI Nana

    Thank you so much!

  • Bretv72

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

  • S2c

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

  • Prostreetphotography

    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.

  • Prostreetphotography

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

  • http://www.facebook.com/people/Harris-David/100001345266761 Harris David

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

  • D Arumugam

    thanks for your help

  • Vickythakre

    Many Many Thanks buddy

  • Jelena

    Many thanks from Jelena N, Belgrade, Serbia

  • Mrix2

    Thank you very much!!

  • jeremey

    EXCELLENT! THANK YOU SO MUCH!

  • Dhas

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

  • R Andrew025

    ThankS alot!

  • 123

    Good one

  • ASHRAJ2204

    THANKX

  • Joe

    Thank You very much. It helps.

  • Shashank TM

    Thank you so much it helped me lot

  • Leo

    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

  • Neeraj Tiwari

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

    • Ceci

      same here! please!

  • http://www.facebook.com/people/Nemanie-Dem/693265856 Nemanie Dem

    Awesome! You saved my day)

  • http://www.facebook.com/people/Nemanie-Dem/693265856 Nemanie Dem

    Awesome! You saved my day)

  • Mav786110

    amazing history project aced

  • V P

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

  • Dilpreet Singh

    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.

  • Linknumbernine

    you are an angel. I love you

  • Thenassa

    thank u. it was really helpful.

  • Spooky

    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.

  • Guset

    Thanks! Very usefull.

  • Imtiaz

    thanks its working goood

  • machimocho

    excellent tip

  • Equinepedestrian

    This has proven to be very helpful!

  • Anonymous

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

    • JJ

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

      • Anonymous

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

  • Caidian Johnson

    … Thank you very much – Worked a treat! …

  • Akhtar Jahan

    Perfect. Thanks

  • http://www.planabrand.com Cindy

    THANK YOU – simple and fast.

  • SRILAKSHMI

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

  • Akhtar

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

  • sunwukong

    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.

  • Marvin

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

  • Paul

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

  • Libor

    Thanks! Smart solution.

  • John

    Many thanks – it’s excellent.

  • Jon Dray

    Look at all the thanks and praise on this topic. I still felt compelled to add mine as well. Those hyperlinks were killing me at my data entry job! Thanks so much for the tip!!

  • Yesssss!!

    THANK YOUUUUUU!!!!

  • Josie

    Perfect removed 792 Hyperlinks in less than 2 seconds.

  • Stiofan

    Thanks. After trying many other hints that failed, this one does the job.
    Brilliant.

  • kevin

    Thanks – works well!!!
    Would be good to remove undelirline and blue font too ;)

  • kevin

    Thanks – worked wel!!

  • kevin

    would be useful to remove font colour and underline too

  • Clive

    Thanks – very helpful, but on my computer using Word 07, alt-F11 doesn’t bring up Visual Basic but splits the document into two parts. I had to use Developer mode to enter VB

  • Gorgeous

    Not so bad. Interesting issues here

  • janet sequeira

    i dont recpie source any more pls remove and stop sending any more thank you

  • Nick

    I am amazed that this seems to have worked so well for so many since I found two major errors, one in the code and another in the text:

    In the code: a CR/LF is required after “Sub RemoveHyperlinks()”, making “Dim oField As Field” the second line. The first line names the macro “RemoveHyperlinks”.

    In the text: The macro is supposed to be executed as follows:

    You can now run the Macro in Word by going to:
    Tools > Macro > Macro and then Run “RemoveAllHyperlinks”

    However, as pointed out, the name of the macro is really “RemoveHyperlinks”

  • amis

    Thank you, It’s very good.

  • amis

    Thank you, It,s very good.

  • Gopal Singh

    hi this is gopal i want remove of image to Microsoft excel

    any one confirm me how to remove image to excel sheet

  • Amanda

    This is not working for me in excel. I have tons of hyperlinks in empty cells and all this does when I run the macro is freeze up and then I have to close and re-open.

    Any more suggestions?

  • misbhavan

    Wish it worked. Keep getting errors like “Compile Error. Expected End of Statement” and “Can’t execute code in break mode.” Any suggestions?

  • abhishek

    I have a very big word document and I want to select all hyperlinks and paste them some where else it is a 40 page document with each page having 10 hyperlinks and paragraphs in between is there a way I can only select hyperlinks

  • David Kirk

    I just tested this in Office Excel 2011 for Mac. The Macro worked like a charm.

    To start the process go to Tools -> Macro -> Visual Basic Editor.

  • Karan Pathania

    Its a lot of trouble. You need not do all this stuff.!!!
    Here is a more simple and easy way:

    1. Press “Ctrl+A”
    2. Press “Ctrl+Shift+F9″

    :) Enjoy !!!

    • Robert

      > Didn’t do a thing in Word 2010.

  • Thomas

    Really nice and easy explanation ! Saved me a lot of time

  • sean

    Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • Stephanie

    Thanks for posting this. It would have taken me hours if I had to remove the links manually.

  • Robert

    Hi Katy,

    I am using MS Word 2010. This macro would be very useful to me. I have copied yours and followed the instructions, but I cannot find ‘Tools’ anywhere… At the top I have File Home Insert PageLayout References Mailings Review and View. In the View there is a Macros item, but the RemoveHyperlins is not displayed.

    Thanks,
    – Robert

  • jakcob

    thank you, very useful info. works perfectly

    in new excel you just need to add MiCRO from Excel options

    go in Excel Start > on the bottom click Excel Options > Customize > in the botom of the add ons chooce View Macros and click Add then you will see the MACRO link on along with Back and forward buttons and you will tun them quickly

  • Khash

    I get a compile error: Syntax Error