Code a custom button

Topic summary

  • Main issue: A custom “Buy Now” button link opens in a new tab when clicked.
  • Technical detail: The anchor tag includes target=“_blank”, which forces links to open in a new tab/window. The rel=“noopener noreferrer” attribute is typically used with new-tab links for security.
  • Proposed solution: Remove the target=“_blank” attribute to open the link in the same tab (default target is _self). Optionally, remove the rel attribute since it’s only relevant for new-tab behavior.
  • Outcome/status: A clear fix was suggested (remove target). No confirmation from the original poster on implementation, so resolution status is unconfirmed.
Summarized with AI on December 16. AI used: gpt-5.

I’m currently using this code below

<a class = "button" href="Page-URL" target="_blank" rel="noopener noreferrer">Buy Now</a>

But when I add this into my store it will open up the custom URL on a different tab. Is there anyway to make a button link to a different page in my store with out opening a new tab?

You can modify the code to open the link in the same tab by removing the target=“_blank” attribute.