CYBER MONDAY30% off everything.40% off Full Access. Lifetime licenses included.See the deals →

Day(s)

:

Hour(s)

:

Minute(s)

:

Second(s)

How to Deliver Your Freebie in Divi So It Actually Downloads

by | Dec 4, 2026

Someone signs up for your freebie. Now they want it.

In Divi, this is where things get a little awkward. The Email Optin module can show a message or send people to another page, but it can’t hand them the file. So they’re told to check their inbox, and they go off to wait for an email.

And when the email arrives, the link doesn’t always work the way you’d expect. A PDF opens in a browser tab instead of downloading. Some files open as a page full of code. And your email tool might not let you upload the file at all.

We ran into all of this setting up our own funnels. Here’s how we solved it: a download button that appears right on the page the moment someone signs up, and a file link that works from your emails too.

What we’re building

Two ways to get the freebie, both pointing to the same file:

1. On the page. When someone submits the form, the form disappears and a short thank-you message appears in its place, with a download button. Same page, no redirect, no waiting.

2. In the email. The first email of your welcome sequence links to the same file, as a backup for anyone who closes the tab before downloading.

We use both on our own opt-in pages. The button gets the freebie into people’s hands straight away, and the email gives them a way back to it later. (If you haven’t built the page yet, start with how to build an opt-in page in Divi.)

Before you start: get your file ready

Upload your freebie to your WordPress Media Library and copy its file URL. You’ll use that one link everywhere.

Keep the file on your own site. The download button relies on a small piece of HTML that browsers only respect for files on the same site. A file on Google Drive or another domain will open instead of downloading.

A quick word on file types, because it matters later:

  • PDFs download from the button. From an email, most browsers open them in a tab, where people can still save them.
  • ZIP files download straight away, from the button and from emails, on most hosts.
  • Other files, like JSON layout files, often open in the browser as a page of code. The simplest fix is to put them in a ZIP. If you have several files, a ZIP is tidier anyway.

Part 1: The download button after signup

How it works

Everything sits in one column, and three CSS classes do the work:
  • The column gets the class subscription-column.
  • The Email Optin module gets the class subscription-form. This is what people see before they sign up.
  • The success content (a thank-you text, the download button, a small line underneath) gets the class subscription-success. This is hidden until they sign up.
When the form is submitted successfully, a short script changes the column’s class from subscription-column to subscription-column-success. A few lines of CSS then hide the form and show the success content. No plugin, no page reload.

Step 1: Build the column

In one column, add these modules, in this order:

1. The Email Optin module, connected to your email provider and list.

2. A Text module with your thank-you message, for example “Your checklist is ready to download.”

3. A Code module for the download button (we’ll fill it in Step 3).

4. Optionally, another Text module for a small line under the button, like “We’ve also sent the link to your email, so you can come back to it anytime.”

Step 2: Add the classes

Now add the CSS classes:
  • Column: subscription-column.
  • Email Optin module: subscription-form
  • Thank-you text, Code module and the small text line: subscription-success
In Divi 4, you’ll find the class field under Advanced → CSS ID & Classes.

In Divi 5, open Advanced → Attributes and click Add Attribute. Set the Attribute Name to class and the Attribute Value to the class name, for example subscription-column.

Step 3: Clear Divi’s own success message

The Email Optin module shows its own success message after signup. We don’t want it, because our thank-you text replaces it.

In the Email Optin settings, open Success Action. Set the Action to Display a message, and type a single space in the Message field. That way Divi shows nothing, and your own success content takes over.

Step 4: Add the button and the script

Open the Code module and paste this in:

<a href="https://yoursite.com/wp-content/uploads/2026/11/your-freebie.pdf" download="your-freebie.pdf">Download your checklist</a>

<script>
// When the Email Optin form is submitted successfully,
// change the column's class so the CSS shows the success content.
jQuery(document).ajaxSuccess(function (event, xhr, settings, data) {
  if (data && data.success) {
    if (settings?.data && typeof settings.data === 'string' && settings.data.includes('action=et_pb_submit_subscribe_form')) {
      const column = document.querySelector('.et_pb_column.subscription-column');
      if (column) {
        column.classList.replace('subscription-column', 'subscription-column-success');
      }
    }
  }
});
</script>

Then change two things in the link:
  • href: your file’s URL from the Media Library.
  • download: the name the file should have when it lands on someone’s computer. This is also the part that tells the browser to download the file instead of opening it.
And change the button text to say what they get. “Download your checklist” beats “Click here”.

What the script does, in plain words: Divi sends the signup to your email provider in the background. The script listens for that, and when Divi reports that a signup went through, it finds the column and swaps its class. If the signup fails (a mistyped email, for example), nothing changes, and the form stays where it is.

Step 5: Add the CSS

Still in the Code module, add the CSS for your Divi version. In Divi 5 it’s under Advanced → CSS → Free-Form CSS. In Divi 4, go to Advanced → Custom CSS → Free-Form CSS.
Divi 5:.
/* The download button */
selector a {
  display: inline-block;
  width: 100%;
  padding: 12px 40px;
  border-radius: 4px;
  background-color: #00aeb9;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
}

/* After signup: hide the form */
body:not(.et-vb-app-ancestor) .subscription-column-success .subscription-form {
  display: none;
}

/* Before signup: hide the success content */
body:not(.et-vb-app-ancestor) .subscription-column .subscription-success {
  display: none;
}
Divi 4: the same, with one difference. Replace .et-vb-app-ancestor with .et-fb-root-ancestor in both places.

Change the button colours, padding and corners to match your brand. Because the button lives in a Code module, this CSS is where its look is set, not a design tab.

By the way, the body:not(…) part is a small trick. It switches the hiding off inside the Divi Builder, so while you’re editing, you see the form and the success content at the same time and can work on both. On the live page, only one shows at a time.

Prefer a Button module? (Divi 5)

In Divi 5 you can use a regular Button module for the download instead: link it to your file, add a download attribute under Advanced → Attributes with the file name as its value, and give it the subscription-success class. Then you can style it with Divi’s own design settings.

You still need the Code module on the page for the script and the CSS. So for most people, keeping everything in one Code module is simpler.

Step 6: Test it

Open the page in a private window, where you’re not logged in, and sign up with a test email. Check that:
  • the form disappears and the thank-you message and button appear
  • the button downloads the file instead of opening it
  • you’ve been added to the right list
Then try it once on your phone.

A few things to know:

  • One form per page. The script looks for the first column with the subscription-column class. If you have two of these forms on one page, only the first will swap.
  • Performance plugins. If you use a plugin that delays or combines JavaScript and the swap doesn’t happen, try excluding this script from it.

Part 2: The same file in your emails

The first email of your welcome sequence should link to the freebie too. But emails work a little differently.

You often can’t upload the file to your email tool

Many email tools only let you upload certain file types for links. MailerLite’s file manager, for example, takes PDFs, ePUBs and images. So if your freebie is a ZIP or a set of layout files, it has to live somewhere else.

The easiest place is your own site. Use the same Media Library link you used for the button. One file, one link, nothing to keep in sync.

The download attribute doesn’t work in emails

The download part of the button only works on your website. A link clicked in an email just opens the file in the browser, and what happens next depends on the file type:
  • A PDF opens in a browser tab. That’s fine for most people, since they can read it or save it from there.
  • A ZIP downloads, because browsers can’t show it.
  • A JSON file (or another text-based file) opens as a page of code. Put it in a ZIP, and the problem goes away.
So the simplest rule for email: if it isn’t a PDF, zip it.

When a ZIP doesn’t download

On most hosts, a ZIP on your own site downloads without any extra setup. If it doesn’t, the usual reasons are:
  • The server sends the wrong file type, so the browser tries to show the file instead of downloading it, and you see garbled text.
  • Security rules or hotlink protection block links from outside your site, or show an error instead of the file.
  • A plugin (membership, download protection or security) puts the file behind a login or a redirect.
  • A CDN or cache in front of your site changes how the file is sent.
Your host can usually sort out the first two quickly. And some browsers or antivirus tools show a warning for a ZIP from a site they don’t know. It doesn’t stop the download, but it’s good to know before someone asks.

Advanced: make files download everywhere with .htaccess

If you’d rather not zip anything, you can tell your server to send certain file types as downloads, wherever the link is clicked. This is done in a .htaccess file, so only use it if you’re comfortable editing server files.

A word of caution: .htaccess controls how your site is served, and a small mistake can take your site offline. Make a backup of the file first.

The tidiest way is to keep your freebies in their own folder, for example /downloads/, and put a .htaccess file inside that folder with this:

<IfModule mod_headers.c>
  <FilesMatch "\.(?i:pdf|zip|json|docx)$">
    ForceType application/octet-stream
    Header set Content-Disposition "attachment"
  </FilesMatch>
</IfModule>

Every PDF, ZIP, JSON or DOCX file in that folder will now download instead of opening, and the rest of your site isn’t affected. Change the list of file types to suit your files.

Two things to check: this only works on servers that read .htaccess files (Apache and LiteSpeed). If your host uses Nginx, ask them to set it up for you. And if you’d rather not touch server files at all, a download manager plugin can force downloads through its own links, though it’s more than you need for one freebie.

What about Google Drive or Dropbox?

They work, and they’re easy. The downside is that people land on a preview page first and have to find the download button there. If you can host the file on your own site, the experience is smoother.

Common mistakes

  • Forgetting to change the sample link. Test the button before sharing the page, not after.
  • Linking to a file on another site. The download attribute only works for files on your own site.
  • Sending a JSON file by email as it is. It opens as code. Zip it first.
  • Leaving Divi’s success message on. Then people see two messages at once.
  • Only testing while logged in. Use a private window, so you see exactly what visitors see.

The takeaway

Divi’s Email Optin module doesn’t hand over the file, but a small Code module can. Three classes, one link and a few lines of script and CSS give people their freebie the moment they sign up, on the same page.

For the email, keep the file on your own site and use the same link. If it isn’t a PDF, zip it, and it will download wherever people click it.

By Mariya Dimitrova

By Mariya Dimitrova

Mariya is a web designer and a co-founder of Powdi Themes and Powdi Studio. With over 10 years of experience working with WordPress and Divi, she focuses on creating beautiful, practical designs and helping others achieve the same. Mariya shares hands-on tutorials, tools, and insights to make building with Divi easier and more enjoyable.