.htaccess
file, making it secure.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.
If you using NGINX server for your site along with X-Accel-Redirect/X-Sendfile or Force Downloads download method, it is necessary that you add this configuration for better security:
# Protect WooCommerce upload folder from being accessed directly. # You may want to change this config if you are using "Redirect Only" method for downloadable products. # Place this config towards the end of "server" block in nGinx configuration. location ~* /wp-content/uploads/woocommerce_uploads/ { if ( $upstream_http_x_accel_redirect = "" ) { return 403; } internal; }
And this the configuration in case you are using Redirect only download method:
# Protect WooCommerce upload folder from being accessed directly. # You may want to change this config if you are using "X-Accel-Redirect/X-Sendfile" or "Force Downloads" method for downloadable products. # Place this config towards the end of "server" block in nGinx configuration. location ~* /wp-content/uploads/woocommerce_uploads/ { autoindex off; }
If you do not know which web server you are using, please reach out to your host along with a link to this support page.
WooCommerce appends a unique string to the filename of uploaded files to enhance 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.
To get started:
Variable products can also have downloadable variations. When adding a variation tick the Downloadable checkbox and more options appear.
Options work the same as regular products: Set the file path, optionally choose a download limit and expiry, and save.
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.
The ordering process for downloadable products is:
Customers can then download files.
The customer receives an invoice/order confirmation with a clickable link to download if the order is processed and paid.
Downloads of digital/downloadable products have unique IDs that are tracked and logged in Reports. More at: WooCommerce Reports.
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.
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).
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 http://yoursite.com/checkout/order-received/ (replacing yoursite.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.
No, this feature was removed in WooCommerce 3.0.
Most definitely! WooCommerce only needs an external URL that points to your digital download file. If it is a valid external download URL, then WooCommerce works perfectly. There is no further validation.
It’s possible to do this with Product Bundles (separate purchase). The use case at Create Downloadable Item Packages shows you how.
WooCommerce allows for the same file extensions defined by WordPress. You can see the full list via WordPress Codex: Uploading Files.