Open External Links in a new tab - expanse

Topic summary

A Shopify store owner using the Expanse theme wants all external links (specifically Google Reviews and Instagram) to open in new tabs automatically.

Current Issue:

  • External links currently open in the same tab
  • Attempted JavaScript solutions have failed to work

Code Attempted:
The user tried implementing JavaScript that:

  • Targets all anchor tags on page load
  • Checks if links are external (different hostname)
  • Sets target="_blank" and rel="noopener noreferrer" attributes

However, the posted code appears corrupted or improperly formatted (contains reversed/garbled text), which likely explains why it isn’t functioning.

Status: The issue remains unresolved and awaits community assistance for a working solution specific to the Expanse theme.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Good morning!

My website: Flower Delivery Ottawa, Best Ottawa Florist, Wedding Flowers – Nectar Flowers Ottawa

I would like to all external links open in new tabs.

For instance this two: google reviews and instagram

I tried the following code and nothing works :disappointed_face: