Search & Replace in Hyperlinks

Search and replace in hyperlink URLs in the current page, section or notebook


Author(s) : Onetastic ★
Category : Find
Last Updated : June 12, 2017
Requirements : OneNote 2010 or above
Screenshot :

Search & Replace in Hyperlinks

Find part of hyperlink
Replace with
Changelog :

June 12, 2017 (E516F3) - Onetastic ★
Added option to do case insensitive search

February 06, 2017 (F693C9) - Onetastic ★
Updated to search and replace hyperlinks in images as well as text

June 20, 2016 (5F05B6) - Onetastic ★
Re-written with the new Macro Language to take advantage of cleaner syntax and performance improvements

These versions are no longer supported:

January 07, 2014 - Onetastic ★
Initial version


Paul Kelly - 2023-07-29
At least part of the problem with intenal links is that they use the & character. This is represented in the XML as & (including the semi colon). If you replace all instances of & with & you may find it works.
If it still doesn't work you can export the page as an .mht file, open it in Edge, right click and select "View page source". You can then find your internal link and look for any characters that are different from those you see when copying and pasting the link.
SBTL - 2022-02-17
Please can you get to work on internal links?...

I just spent hours setting up Bible notes and 100s of links are broken >.< It would take many hours to fix them manually...

Can you not just get to search for all instances of a link like:

And then paste in a new one that will change all the ones it finds?..
SBTL - 2021-12-28
I'm trying to replace internal links from a Notebook on Onedrive.

It's not working so far. It says it can't find the link.

I'm using 2016, and tried the version from windows and cant find any setting to "Go to Settings > Show Page XML" to be able to edit the links to a format it understands...

Any chance the macro can be modified to accept internal links without needed to edit links?..