Purchase here and earn points Buy Exclusive Apps & Scripts

Google Drive Direct Link Generator

NOTE: This will only work for the files that you UPLOAD to Google Drive.

For WordPress users: If you face a Google Drive Direct Link Download problem for woo-Commerce Products: Follow the below given steps on the left.

Supported link formats:

  • https://drive.google.com/open?id=12Bsgrhm4Zstxjj4sjK456eepXlmbjTJ0
  • https://drive.google.com/file/d/12Bsgrhm4Zstxjj4sjK456eepXlmbjTJ0/view?usp=sharing

Modifying Woo-Commerce Download Handler

Step 1: Sign in to Cpanel and navigate to public_html/wp-content/plugins/woocommerce/includes/class-wc-download-handler.php. Then right on it and press Edit.

Step 2: Copy below code and Paste after line 194 & hit Save Changes
$product = wc_get_product( $product_id );
$drive_filename = $product->get_downloads();
foreach( $drive_filename as $key => $each_download ) {
$filename = $each_download[“name”];

Step 3: Paste the Google Drive Share Link on above text field and paste the exact file name with extension in the next text field. (This method works only with .zip formats, So upload every files in zip format)

How to get your sharing URL ->

Step 4: Hit Create Direct Link button on this site. Copy the entire Google Drive Direct Download Link.

If you don't do the Step 2 Woo-Commerce product/s won't download as recognizable files. As mentioned in Step 3 upload all file/s in zip format & paste the exact file name with .zip extension before you hit Create Direct Link button on this site.

IF NOT ZIP FILE, file/s will get download as MP4.

IF ZIP FILE, file/s will get download as zip & works fine. Tested.

When Downloading...

How to get your sharing URL

Step 1: Go to Google Drive and right click the file that you want to share & and hit share or select the file and click the share or link icon on top.







Step 2: On the window that comes up, click "Get shareable link". When clicked on bottom left corner Google Drive shows that Link copied to clipboard.

Step 3: Make sure the dropdown is set to one of the "Anyone with the link..."
or "Anyone on the internet..." options, then click "Copy link".

Step 4: Now just paste that link into the text box above and create your direct link. Enjoy!

  1. Nice Post! Thank you so much for sharing this wonderful tool to generate google drive direct download link. But you can also do the same using simple tricks mentioned in this blog. Visit Here —> https://bit.ly/35Wx1Vj

    • Yes! that’s true. That link only shows how to create google drive direct link. Creating google drive direct link is simple. But adding direct links as virtual products in WordPress won’t work correctly. For that you need to do some other steps too. The steps are posted in this page or you can watch the video above. (https://www.youtube.com/watch?v=Q5uqqIymwZE&feature=emb_title)

      • Hey! Glad you shared this wonderful video on adding direct links as virtual products in WordPress. It works great and Keeps sharing such videos . Keep up the good work…

        • Thank You.. Yes, we are doing more new things to improve and to improvise our works. Let us know if you need any help with your works. We are here to help you! : )

  2. thank you so much for your solution it is work properly with small files but with large files it is not working , can you find any solution for large files And if there is no solution with Google Drive can you explain any way works with oneDrive cloud because when using OneDrive with woocommerce ,the file downloaded without any extension .
    thank you for your support

Leave a reply

Select your currency
USD United States (US) dollar
Reset Password