Changes from your current version: it now also listens for CookiebotOnLoad, watches the page with a MutationObserver, and drops the #CybotCookiebotDialog restriction so it catches the link wherever Cookiebot puts it. 2. _Header.cshtml (line 136) Find thi window.addEventListener('CookiebotOnDialogInit', removeBrokenDsrLink); window.addEventListener('CookiebotOnDialogDisplay', removeBrokenDsrLink); window.addEventListener('CookiebotOnLoad', removeBrokenDsrLink); document.addEventListener('DOMContentLoaded', function () { new MutationObserver(removeBrokenDsrLink).observe(document.body, { childList: true, subtree: true }); removeBrokenDsrLink(); }); })();