How to Set Expiration Dates for Shared Google Drive Files

When you share any file or folder in Google Drive with another user, the shared links will work forever unless you manually change the sharing permissions. For instance, if you have shared a document with an external vendor, they’ll continue to have access to the file long after your business contract may have ended.

In such a situation, wouldn’t it be nice if you could set expiration dates while sharing files in Google Drive? For instance, share a document temporarily for, say, 10 days and access to the file should be revoked automatically after that period has passed.

Google Drive does let you set expiration dates for shared links but this option is only available to paid Google App for Work accounts.

Well, no worries. If you have a free Google account, you can still create temporary links that auto-expire after a certain time. Here’s a step by step guide:

  1. Go to labnol.org/expire and authorize the web app to access your Google Drive.
  2. Open the File Picker and select any file or folder in your Google Drive that you would like share.
  3. Enter one or more email addresses (comma separated) of users who should be given viewer (read-only) or editor (read & write) access to your file.
  4. Finally, specify the time period after which the access should be limited. You can say 5 hours or 3 weeks or even 2 years.

Click the “Set Expiration” button and you are done. The Google Script will set a time-based trigger that will automatically remove the specified user from the access list after the specified date and time.

You can also use the Google Drive Auditor add-on to analyze the shared permissions of every file in your Google Drive and know who can see your files.

The auto-expiry app will list all the files and folders that are set to expire after a certain period. You can click the “cancel” link against any Drive link to prevent that shared link from expiring automatically.

Select File in Google Drive

Auto Expire Google Drive Shared Links

Also see: Make a Google Drive Tree (video)

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.