I have now found a solution myself. There is an add on for OneNote macros which is called Onetastic. On the website you can also download a selection of already programmed macros. One is "Search and Replace in Hyperlinks". This macro will let you enter a phrase (or link-part) that you want to search for and then what you want to replace it with.
Caution is needed where one has uses spaces in links.