1. Home
  2. Knowledge Base
  3. Document Library Pro
  4. Advanced Usage

How to auto-sync your document library with Dropbox, Google Drive etc.

Sometimes it's useful to automatically synchronize your WordPress document library with a third party platform where you are storing your files - for example, so that a document is automatically created on your WordPress site whenever you add a new document to Dropbox/Google Drive/Microsoft One Drive or whichever file storage system you use.

This article explains how to do this by integrating Zapier with your WordPress document library. You will need:

You can then set up zaps (i.e. automations) in your Zapier account which will add documents from Document Library Pro whenever files are added to a particular Dropbox/Google Drive/etc. folder. Your document library will link to the file directly on Dropbox/Google Drive/etc. so you update the file in future without worrying about things getting out of date on the WordPress site.

Adding documents

How it works

You can use Zapier to automatically add a new document to the WordPress document library whenever a new file is added to Dropbox/Google Drive/etc. However, there are some limitations and compromises that you need to be aware of before you set this up.

You can use Zapier to create documents and populate the fields which are part of WordPress itself, such as the document title, content, categories and tags. However, it is not possible to populate the custom data fields which are created by Document Library Pro. These are:

  • Document links - The Document Link field in Document Library Pro is a custom field, so it is not possible to populate it from Zapier in order to automatically create the usual download buttons. Instead, the setup instructions below explain an alternative method in which you will insert a link to download the document into the main content field of the document post. You can display this in the document library, instead of the usual 'link column, so it will look similar to users even though it's set up differently.
  • File previews - The file previews in Document Library Pro depend on the Document Link field, which as explained above cannot be populated by Zapier. As a result, no preview buttons will appear for documents which you add using this method.
  • Document categories and tags - While Zapier appears to allow you to add categories and tags, these are actually WordPress categories and tags rather than the special custom taxonomies which are part of Document Library Pro. As a result, you can't use this method to categorize or tag  documents.
  • File size - You cannot automatically display the file size.
  • Document author - Zapier can add the same post author to each document, which you can then display as a column in the document library if required. It cannot populate the 'Document Author' field.

Given these limitations, here's a screenshot showing the sort of dynamically created document library you can realistically build using this method. (You can style the Download links as buttons and change the text using the instructions below.)

Dropbox document library in WordPress

Once Zapier has added a document to your document library, you can manually edit it in the WordPress admin to add the missing information as needed. Once you have done that, then you can use the full features of Document Library Pro - whereas the above screenshot shows what is possible with no manual input.

Setup instructions

The following instructions explain how to add a new document to Document Library Pro whenever a new file is added to a Dropbox folder. The instructions are similar for other platforms such as Google Drive - just select the relevant platform instead of Dropbox in Step 1, and bear in mind that the field names in Step 2 might be slightly different.

  1. Log into Zapier and create a new zap.
  2. Step 1:
    1. Select the third party platform where your files are stored (e.g. Dropbox). Follow the onscreen instructions to authorize access to Zapier.
      Sync document to Dropbox Step 1
    2. For the 'Trigger event' field in the 'Setup' tab, search for 'New File in Folder'.
    3. On the 'Configure' tab, select which Dropbox folder you wish to sync with the document library, and whether to include subfolders and the contents of your Dropbox files.
    4. On the 'Test' tab, Zapier will test the connection with Dropbox by retrieving a file from the folder you selected. (If you haven't added any files to Dropbox, then do so now and repeat the test.)
  3. Step 2:
    1. Click 'Add Step' and search for 'WordPress'.
    2. Select the WordPress app and 'Create Post'.
    3. In the 'Account' field, enter the login URL, username and password of the WordPress site where you're using Document Library Pro. (Note: This must be an admin-level user account which doesn't use 2 factor authentication.)
      Zapier create WordPress document when file added
    4. For 'Action Event', select 'Create Post'.
    5. Now move to the 'Configure' tab:
      Configure Document Library Pro Zapier sync

      • Post Type - Start typing 'Documents' in the search box and select Documents/dlp_documents).
      • Title - Start typing 'File Name' into the search, and select '1. File Name'.
      • Content - This is where you need to add your download button or link. To add a simple link to the file on Dropbox, add the following: <a href="[1. Share Link]">View on Dropbox</a>. Replace "[1. Share Link]" with the actual merge tag from Zapier. To get this, click where you want to insert the file URL and search for 'Share Link', then select it. This will insert the merge tag into your link along with the URL of the test file that Zapier retrieved in the previous step - make sure it looks similar to the screenshot above.
        Tip: If you want to style the link as a button, then you need to add the code for a clickable button. This depends on your theme, or if you're using a page builder then you can use the button shortcode. Just make sure you add the code to make it a link and include the 'Share Link' from Dropbox.
      • Other fields - You can also select other data which will be added to the document on your WordPress site, such as the author These are standard WordPress fields, which is why it's possible to add them via Zapier in this way. Unfortunately it's not possible to populate the custom fields or taxonomies which are added by the Document Library Pro plugin, such as the file size or type. It is also not possible to use the categories and tags fields, because these refer to WordPress post categories and tags rather than Document Library Pro's categories and tags.
    6. Next move to the 'Test' step and run a test. Zapier will look in your Dropbox/Google Drive/etc. folder and use it to create a document on your WordPress site. Check the 'Documents' section of the WordPress admin to verify that the document has been added correctly and looks as expected.
    7. Finally, Publish your zap.

The finished zap should have these steps:

Document Library Pro Zapier zap steps

Editing files

When you follow the above method to add documents, the download link will go straight to the location of the document on Dropbox/Google Drive/etc. This means that when you update the file in future, the changes will automatically be reflected in your WordPress document library. The important thing is that the URL doesn't change.

Stuck? Where to get support

While you don't need to be a developer, creating zaps is quite an advanced task. As a result, it's not covered in our plugin support for Document Library Pro customers.

If you get stuck, then you can get help from the following sources:

  • Zapier support - Zapier provide excellent support and can advise on any errors in your zaps to help you getting them working correctly.
  • Order a custom integration - If you'd like us to integrate Document Library Pro with Dropbox/Google Drive or similar for you, then we'll be happy to provide a quote under our plugin customization and integrations service. Please complete the form with details of exactly how you'd like the zap to work, and we'll send a quote for setting it up for you.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.