Woocommerce downloadable product

New Page

  1. Documentation /
  2. Management of digital/downloadable products

Management of digital/downloadable products

Installation and configuration ↑ Back to top

  1. Navigate to: WooCommerce > Setup > Products > Downloadable Products .
  2. Select a  file download method from    the dropdown menu.
    • Force downloads  : les téléchargements d’archives vers force via PHP . To ensure files are protected from direct linking, Forced Downloads can be used. The files are served by PHP. However, if your files are large or the server is underpowered, you may experience timeouts while downloading. In this case you should look at your server or user’s redirect method.
    • X-Accel-Redirect/X-Sendfile  : le server (nginx/apache) gère les downloads. This method requires that the X-Accel-Redirect/X-Sendfile module be installed and enabled on the server. Please confirm with your web server that one of these modules is installed before using this method. It is the most reliable method because the file is sent directly to the client and gives the client the best performance. The files are also protected by a .htaccess file, which makes it secure.
    • Redirect Only (Unsafe) – When users download a file, its link redirects to the file. Using this method means that your files will be unprotected and whoever has the upload link will be able to access the file, even when you are not logged in.
  3. If you once selected Force  Downloads or X-Accel-Redirect/X-Sendfile , it is also possible to authorize the use of the redirection mode (insecure) with the same resource configuration  . When enabled, if for some reason an individual file cannot be served via your preferred method, a redirect will be used instead. This comes with similar drawbacks as mentioned above regarding  Redirect only (insecure) , but it can still be useful in situations where you host assets on a variety of different platforms and where some of them are not suitable for your preferred method.
  4. Elija a level of access restriction .
    • Check the Downloads require login checkbox if you want users  to log in to download files . Guest checkout should be disabled.
    • Check the Grant access to downloadable products after payment box  if you want to grant access to files when orders are Processing, rather than Completed.
  5. Select Add a unique string to the file name for security  if you want to ensure the security of your files is enhanced. Turning it on is recommended and will do so by default, but it’s not required if someone correctly set up your upload directory. No file names or links will be affected when you turn it on, only files uploaded when this setting is checked will have a unique string added. This configuration is fully compatible with previous versions and may be disabled by volunteers affecting the liens of general archives.
  6. Guard changes.


Please note that additional settings can be found in the WooCommerce > Settings > Products > Approved Download Directories screen (linked to from this screen). These further settings are particularly useful in sites where there are one or more shop managers, or other users with the ability to edit products. Click here to learn more.

Protecting your uploads directory ↑ Back to top

By default WooCommerce introduces a .htaccess file to protect your wp-content/uploads/woocommerce_uploads directory, however, this doesn’t guarantee the protection of this directory, since everything depends on the configuration of the server.

Using NGINX Server?

If you are using the NGINX server for your site with the X-Accel-Redirect/X-Sendfile or Force Downloads download method , it is necessary that you add this configuration for better security:

# Protect WooCommerce download folder from direct access. # You may want to modify this configuration if you use the “X-Accel-Redirect/X-Sendfile” or “Force Downloads” method for downloadable products. # Place this configuration near the end of the “server” block in the NGINX configuration. location ~* /wp-content/uploads/woocommerce_uploads/ { if ( $upstream_http_x_accel_redirect = “” ) { return 403; } internal; }

And here is the configuration if you use the redirect-only download method:

# Protect WooCommerce download folder from direct access. # You may want to change this configuration if you are using the “Redirect only” method for downloadable products. # Place this configuration near the end of the “server” block in the NGINX configuration. location ~* /wp-content/uploads/woocommerce_uploads/ { auto-index disabled; }

If you are unsure which web server you are using, please contact your web host with a link to this support page.

Unique string after filename

WooCommerce adds a unique string to the filename of uploaded files to improve security.

It is recommended to be turned on and will be turned on by default, but it’s not required if you have already properly configured your upload directory. No filename or links will be affected when you turn it on, only files uploaded when this setting is checked will have a unique string added to them.

This is setting is fully backwards compatible and can be turned off-on at whim without affecting any already generated file links.

You can access this setting by going to WooCommerce > Settings > Products > Downloadable products.


Creating downloadable products ↑ Back to top

Downloadable Simple Products ↑ Back to top


To get started:

  1. Go to: WooCommerce > Products > Add Product to add a new Simple product as outlined in Adding and Managing Products.
  2. Tick the Downloadable checkbox:
  3. After ticking this box, other options appear – Downloadable Files, Download Limit, Download Expiry.
  4. Select the Add file button, and then name the file. Enter the downloadable URL if it’s hosted elsewhere, or select the Choose file button to either insert an existing file from your Media Library or to Upload a new file. Upload the file and click Insert to set up each downloadable file URL.
  5. Enter “Download limit” (optional). Once a user hits this limit, they can no longer download the file.
  6. Enter “Download expiry” (optional). If you define a number of days, download links expire after that.
  7. Once you’ve completed this edit to the product, press Publish or Update as usual.

Downloadable Variations

Variable products can also have downloadable variations. When adding a variation tick the Downloadable checkbox and more options appear.


Options work the same as Simple Products: Set the file path, optionally choose a download limit and expiry, and save.

Combining Downloadable and Virtual products ↑ Back to top

If you tick the Downloadable checkboxes, products can have stock and are treated as physical products. This allows you to sell downloads and real products together.

If you want to add/sell a downloadable product that does not have a physical component, enable the Virtual option.

Usage ↑ Back to top

The ordering process for downloadable products is:

  1. The customer adds a downloadable product to their cart.
  2. The customer checks out and pays.
  3. After the payment, several things can happen depending on your setup:
    • If items in the order are all downloadable + virtual, the order is completed.
    • If items are physical and downloadable/virtual, the order is processing until you change it.
  4. Once complete, or if the option “Grant access to downloadable products after payment” is enabled, the customer can:
    • Be granted download permission
    • See download links on the order received page
    • See download links in their email notification
    • See download links on their ‘My Account’ page if logged in

Customers can then download files.

Invoice/Order Email ↑ Back to top

The customer receives an invoice/order confirmation with a clickable link to download if the order is processed and paid.

digital download email

If your Completed Order emails do not include links for the download files, then there may be an issue with your site’s database, which we have a guide for fixing here: https://woocommerce.com/document/completed-order-email-doesnt-contain-download-links/

Managing Orders with Downloadable Line items ↑ Back to top

  1. Go to: WooCommerce > Orders and select the order to view or edit.
  2. Scroll down to the Downloadable Product Permissions meta box, which displays the download and how many times the customer had accessed it.
  3. Revoke access, grant access to new downloads, or exit order.


Download logs/reports ↑ Back to top

Downloads of digital/downloadable products have unique IDs that are tracked and logged in Reports. More at: WooCommerce Reports.

FAQs ↑ Back to top

What happens if I edit a downloadable product’s files after customers have purchased it? ↑ Back to top

  • Editing a download file row (changing the name, file URL or both) updates the download links on past purchases, but it leaves the expiry date and downloads remaining intact.
  • Adding a new download does not affect past orders. Only new purchasers gain permission to download it.

If you have products that grant ‘lifetime access’ or similar to all downloads added to a product, a subscription or membership may be more appropriate. You can also combine files into a single archive (zip). If you want to restore previous functionality, there is a plugin available here.

Do old orders get access to new downloads after a product is edited? ↑ Back to top

No, this feature was removed in WooCommerce 3.0.

Why does WooCommerce link to the URL of the file? ↑ Back to top

When setting up your downloadable product, ensure that the downloadable file settings use the same URL formatting that your site does. Make sure that it matches the site URL in your WordPress settings. (i.e. if www is in your site URL, it needs to be in the file URL).

Why don’t I see a file link on the order received page? ↑ Back to top

If you are using PayPal, there is a delay when using the IPN to track payments. You can instead enable Payment Data Transfer (PDT) by going to gateway settings and selecting it as the PayPal Identity Token.

Payment Data Transfer (PDT) is a notification service that, once activated, can send transaction-related information immediately to merchants who are using PayPal payment buttons (PayPal Payments Standard). Merchants can display these transaction details on their website to confirm the buyer’s payment was successful.

You can enable PDT in your PayPal account under Profile > Profile and Settings > My Selling Tools > Website Preferences.

Enable auto-return, and enter the return URL as https://shipyouridea.com/checkout/order-received/ (replacing shipyouridea.com with your site’s address), then enable PDT. Copy your identity token to your settings under WooCommerce > Settings > Checkout > Paypal. This will allow payments to be verified without the need for PayPal IPN.

¿Puedo usar el almacenamiento en la nube para almacenar mis archivos y descargas? ↑ Volver arriba

¡Definitivamente! WooCommerce solo necesita una URL externa que apunte a su archivo de descarga digital. Si es una URL de descarga externa válida, entonces WooCommerce funciona perfectamente. No hay más validación.

Links from some cloud storage providers, such as Google Drive, only work when the isa file download method is set to Redirect only (insecure) . The Installation and configuration section explains the difference between the methods.

How do I create a song download album to sell music? ↑ Back to top

It is possible to do this with product bundles (purchase separately). The use case in Creating Downloadable Item Packages shows you how to do this.

What file extensions can I use? ↑ Back to top

WooCommerce allows the other archive extensions defined by WordPress. Read the complete list through WordPress Codex: Subir archivos .

What is the maximum file size that can be used? ↑ Back to top

WooCommerce itself has no limitation on the maximum file size that can be used, however your website server likely has a maximum limit. Contact your hosting company to increase that limit.

Why don’t my order completion emails include links to the download files? ↑ Back to top

There may be a problem with your site’s database. We have a troubleshooting guide available here: Order Completed Email Does Not Contain Download Links

I attached a media library file to a product. How can I secure the file and make it unreachable? ↑ Back to top

When you upload a file from the media library instead of using WooCommerce for the upload, anyone with a link will be able to access the file because the WordPress media library is inherently public, it’s where all images attached to posts are placed and pages.

When creating a downloadable product, you need to upload the file from WooCommerce instead of selecting a file from the media library. If you upload the files from the Edit Product page, WooCommerce uploads those files and places them in a woocommerce_uploads folder that is not accessible to the public. And, if you’re linking to a file stored in an external location, make sure you’re using a file download method that secures the file.

Las descargas forzadas requires that “allow_url_fopen” is activated ↑ Go back to the screen

Forced uploads require PHP functionality, so for this to work, the allow_url_fopen function in PHP must be set to On .

To check the status of allow_url_fpensu site, create a phpinfo() page to describe here, install one of WordPress.org’s phpinfo addons, or contact your host’s support.



Google Google translator

Google Google Translate

Google Traduction

Video Woocommerce downloadable product

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…