Articles on: Advanced features

How to open blog posts in the same tab

Copy the following code:

<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

Was this article helpful?

Share your feedback

Cancel

Thank you!