Shopify themes, liquid, logos, and UX
Hello,
I am trying to get my customers to auto download a PDF when they click on a link on my product page. Each product will have a different link, so I set up a metafield URL for the PDF and embedded the url to the product page (see image). Right now, the link just opens to a new tab. Is there a way to HTML code it so it auto downloads the PDF when you click on it?
Website: greenlyliving.co
password: pdf
Thanks in advance.
hello there
Yes, there is a way to code the link so that it auto downloads the PDF when clicked. You can add the "download" attribute to the link, like this:
<a href="your-pdf-url.pdf" download>Link text</a>
Just replace "your-pdf-url.pdf" with the URL of your PDF file and "Link text" with the text you want to use for the link.
This should force the browser to download the PDF instead of opening it in a new tab. However, please note that this behavior may vary depending on the browser and device being used by your customers.
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
Hello,
Yes I tried adding the download attribute, but it does not auto download, it just opens into a new tab. See pic. Is it possible that it's a metafield that's causing it to open to a new tab? Trying to see if there's a work-around for this.
Also I uploaded the PDF onto Shopify files.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025