How to open blog posts in the same tab
Copy the following code:
Add it to Blog settings -> Blog home page -> </body> code
Save the changes, and you're all set!
<script>
document.addEventListener('DOMContentLoaded', () => {
const updateLinks = () => {
document.querySelectorAll('a.js-post-item.post-item[target="_blank"]').forEach(link => {
link.setAttribute('target', '_self');
});
};
updateLinks();
const observer = new MutationObserver(updateLinks);
observer.observe(document.body, { childList: true, subtree: true });
});
</script>
Add it to Blog settings -> Blog home page -> </body> code
Save the changes, and you're all set!
Updated on: 03/12/2024
Thank you!