How to Automatically Backup Your WordPress Site to Google Drive

If you’re a regular user of Google services, then Google Drive may be the most convenient way for you to back up your WordPess site. It only takes a few minutes to set up with the help of the new Google Drive for WordPress plugin. We’ll walk you through the backup process step by step so that you can start scheduling your site for automatic backups.

Step 1: Install Google Drive for WordPress

Google Drive for WordPress is free from the WordPress plugin repository. Install and activate the plugin and you’ll be ready to start configuring your app.

Step 2: Configure your Google account to give API access to the plugin

Once activated, the plugin gives you a new “Configure Google” menu item. Navigate there within your WordPress dashboard and then click on the link to the ‘Google API Console’ to create an OAuth 2.0 client ID.

Give the project a name, ie. “Site Backups”, and upload a logo for it (*optional).

Go to ‘API Access’ tab and click on ‘Create an OAuth 2.0 client ID’.

Step 3: Create a Client ID

Select “Web Application”. You’ll also want to click on “More Options” where you’ll be able to paste in the Authorization Redirect URI, as specified by the plugin in your WordPress dashboard. The ‘Authorized JavaScript Origins’ should be your site’s URL.

Create the Client ID and then scroll down to get your Client ID and Client Secret.

Step 4: Authorize access

Paste the Client ID and Client Secret into the plugin settings page in your WordPress dashboard. Now click “Allow Access”.

Step 5: Customize your backup settings

Now that you’ve authorized Google to receive your backups, you’re ready to customize the plugin’s backup settings. Check the boxes for directories you want to exclude from the backup. You can also choose to include a backup of your site’s database and set the frequency for the backup schedule.

Click Save and your backups will be scheduled. You can also perform a one-time backup by going directly to Configure Google >> Backup in the plugin’s settings.

Step 6: Check backups on Google Drive

The last step is to go to Google Drive and check to ensure that your backups are being performed on schedule. Click on “My Drive” to see your recent backups, which will appear as zip files in your list.

If for any reason your blog is ever compromised or you experience data loss on your server, your files and database will be safely waiting for you on Google Drive. You’ll have access to your backups from any computer or mobile device, as well as the ability to quickly share the backup through Google Drive to another user. Get your site set up for automatic WordPress backups with Google Drive if you don’t yet have a system already in place. You just may thank yourself for it in the near future!


Comments (33)

  1. I will readily confess to having tried bunches of different solutions to taking consistent backups of WordPress sites. Found a winner here. Perhaps biased because I run way too much of my digital life around Google services, but this one set up flawlessly, worked perfectly and well, is a solution I think I can stay with.

  2. I second BackWPUp; even more so I recommend to my students to use a paid service such as VaultPress either in tandem with a self-backup or by itself so that when the worst happens, you have actual support people helping you to restore things AND clear out any malicious junk that got in there….

  3. Since you could list multiple URIs and JavaScript origins, it seems you could control backups of multiple sites with one setting. I tried two sites; the first one went OK, but the second generated an error that the token had not been received.

    So I deleted the second URI and JavaScript origin. When I tried to reconfigure the first site, I got the missing token message with that site! I created new Client IDs for both sites, and both were configured OK.

    So I guess I’ll create separate Client IDs for each website, but I still wonder why you could enter multiple URIs and JavaScript origins if you could only have one website per Client ID.

    • Uh, oh. I tried a manual backup and got this error:
      Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8534958 bytes) in /home/lane/public_html/wp-content/plugins/wp-google-drive/class/zip-class.php on line 26

      I guess this means I’ve got to mess with php.ini. Ugh.

      • Yep, changing 32M to 64M in php.ini fixed it… or at least it backed up this time.

        The backups have filenames like, which gives no clue about which website it is. I’ve prepended the domain names to the two I tried, and it will be nice if future backups have the same number.

  4. This is a really useful plugin and thank you for the very thorough setup instructions.

    The plugin could be greatly improved by adding the simple option of selecting where in your Drive to save the backups. Also, I’m not quite sure it’s Multisite compatible… it doesn’t seem to be visible from the Network Admin, even if Network Activated. I’ve Activated it for my main site and so I’m hoping it backs up the full database and full network files.

  5. Getting a fatal error on the ‘On time backup’ after set up
    Fatal error: Class ‘ZipArchive’ not found in /home/*****/wp-content/plugins/wp-google-drive/class/zip-class.php on line 10

    • I think you are not enabled https on “Registered PHP Streams”

      Please check phpinfo & enable https in “Registered PHP Streams”

      Registered PHP Streams : compress.zlib, php, file, glob, data, http, ftp, phar

      It should like this

      Registered PHP Streams : compress.zlib, php, file, glob, data, http, https,ftp, phar

    • Surely i can say it is safe , because files move to google drive with well configure user account , anyother user can’t able access from out site

      it is portable, we can access from anywhere and 5GB free for each account

      • I read all your help comments, went to my plugin folder and deleted this Google plugin. Why? Because it should not be so complicated.

        Every plugin I installed (and I installed and uninstalled dozens of them) worked without a problem. Except Google plugins. This one and the track plugin are just dumb and complicated.

        In my humble opinion, Google complicate things to a level of ridiculousness. The tracking script was a winner, I am clicking and moving from window to window and after five minutes of trying to Figueroa out what the hell is going on I deleted it.

        This one is, unfortunately, no different. Installing it is a joke. Go here click that, copy this, do that. Seriously? And I know CSS, HTML some PHP and overall Internet stuff much better than average user.

        No thank you, I will use the simple back up plugin. I get an email every 12 hours or so and that’s it.

  6. Hi!

    I managed to install and configure this plugin. Everything seems ok but when I made a “one time backup” I get this error:

    “Warning: file_get_contents(/homepages/13/d423835297/htdocs/logs/traffic.html/.md5sums) [function.file-get-contents]: failed to open stream: Permission denied in /homepages/13/d423835297/htdocs/wp-content/plugins/wp-google-drive/class/zip-class.php on line 28
    Backup Successfully Updated to Google drive .”

    I see in line 28 of “zip-class.php” and says:

    $zip->addFromString( str_replace( $source . ‘/’, ”, $file ), file_get_contents( $file ));

    I change permission for zip-class.php on server, but the error appears agin. Any clue of what´s is going on? And also.. Do I am doing the backup correctly??

    Funny thing, is that in Google Drive a Got a New Folder with the backup! :O

  7. i got this error.. pls help me

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 52641613 bytes) in /home/amaankha/public_html/blog/wp-content/plugins/wp-google-drive/class/zip-class.php on line 28

  8. The most common fix to this is updating a few settings in php.ini .. look for the directive:


    And bump it up .. one site that is running this successfully everyday has a setting of 256 Mb for that directive.

  9. Thanks Sarah..It works.At first i got a problem with ”Error: redirect_uri_mismatch The redirect URI in the request”.But when i set the Redirect URIs as the settings page it works fine. :) Thanks again.

  10. i’ve successfully set up the connection to Gdrive, but upon clicking on time back up i get this:-

    Warning: is_dir() []: open_basedir restriction in effect. File(/home/property/public_html/blog/wp-activate.php/) is not within the allowed path(s): (/home/property:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/property/public_html/blog/wp-content/plugins/wp-google-drive/class/zip-class.php on line 55

    how to fix that? thanks!

  11. Fatal error too me:

    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 5154287 bytes) in /home/neocsat/public_html/wp-content/plugins/wp-google-drive/class/zip-class.php on line 28

    Fatal error: Maximum execution time of 30 seconds exceeded in Unknown on line 0