All Collections
Widgets and Advanced How-to's
How to Stop Links Opening in a New Tab
How to Stop Links Opening in a New Tab

Super defaults to opening external URLs in a new tab - here's a way to change that

Charlene Abranilla avatar
Written by Charlene Abranilla
Updated over a week ago

If you find that links open in a new tab when you click them, you're not alone. This is a feature of Super's default settings.

If you'd like to change this you can use this script to do this in the Code > Body section

<script> 
if(document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded',afterDOMLoaded);
} else {
afterDOMLoaded();
}
function afterDOMLoaded(){
//Everything that needs to happen after the DOM has initially loaded.
Array.from(document.querySelectorAll('a[target="_blank"]'))
.forEach(link => link.removeAttribute('target'));
}
</script>
Did this answer your question?