Depending on what you mean by "disable", you can use JavaScript's onclick event and have it return false. That will "disable" the link, meaning, when you click the link, absolutely nothing happens. The return false statement will break the links default behavior, which is to redirect the user to whatever reference (href) is made.
Example: <a href="my/path" onclick="return false;">Click me and nothing happens!</a>
If you by "disable" mean, hide the element so that it's not interactable at all, you can use the CSS property visibility
and set it to hidden
.
Example: <a href="my/path" style="visibility: hidden !important;">No one can see me!</a>
The "!important" keyword basically just means that the CSS interpreter should prioritize that CSS rule over other rules. That way, you're almost positive that your CSS rule will be applied in all cases.
Instead of inline styling, you could of course use CSS classes etc. to apply the same CSS, which might come in handy if you have a few links, or other elements that you wish to "hide".
You could also look into CSS pointer events, which will basically be the "non-JavaScript" version of the same JavaScript solution that I provided earlier.