How to migrate WordPress Media to Google Cloud Storage illustrations

In the previous tutorial, we showed you how to migrate media to Amazon S3. Today, we will show you how to uninstall media from the WordPress website to Google Cloud Storage and several options for providing media services directly from Google Cloud Storage or CDN.

Google Cloud Storage is only a small part of the many products and services on Google’s cloud platform. Because Google has a huge infrastructure and the fact that they handle bulk storage, they can provide very low storage costs. Much lower than the WordPress host.

typically, cloud storage like this is for sites that need to use solutions such as our external backup plug-in for additional backups or are providing large files (images, photos, downloads, software, videos, games). Some of their customers include Spotify, Vimeo, Coca-Cola, Philips, Evernote and Motorola.

  1. CDN Cloud Storage and Google Cloud
  2. Google Cloud Storage pricing
  3. WP-Stateless WordPress Google Cloud Storage Settings
  4. WP Offload Media WordPress Google Cloud Storage Settings

Google Cloud Storage and Google CDN

do not confuse Google Cloud Storage with Google Cloud CDN or any other CDN provider. The content delivery Network (CDN) is designed to accelerate media delivery, while Google Cloud Storage is designed for mass storage solutions.

, however, Google Cloud Storage can help you speed up your site because it uses so-called multi-area storage. This means that your Google Cloud Storage content is stored in multiple locations within the area and delivered from it, similar to CDN. It even uses the same edge caching technique. However, it is important to note that this is not global and may have a higher latency than a mature CDN solution. Google Cloud Storage allows you to choose between three regions:

  • Asia Pacific
  • European Union
  • US

but we will show you how to use CDN with Google Cloud Storage below.


Cloud Storage pricing Google Google Cloud Platform offers new customers a free trial period of $300 for three months. If you have never been a paying customer of Google Cloud Platform and have not previously signed up for a free trial, you are eligible. This is a good way to test Google Cloud Storage and see if it is suitable for your site before paying any fees. Please refer to free trial FAQ and Google Cloud Storage pricing.

How to migrate WordPress Media to Google Cloud Storage illustrations1

Google Cloud free trial of

WP-Stateless ‘s WordPress Google Cloud Storage Settings

‘s first option for integrating Google Cloud Storage with WordPress sites is to use the free WP-Stateless plug-in, which was developed by Usability Dynamics’s excellent team.

this plug-in automatically copies files from your WordPress site to Google Cloud Storage when uploading files to the library. It then provides different modes, such as backing up your media copies, or even removing media from WordPress and providing services from Google Cloud Storage.

How to migrate WordPress Media to Google Cloud Storage illustrations2

WordPress plug-in-WP-Stateless

is still new on the block, but it has a high reputation and is actively being maintained and updated. At the time of this writing, it currently has more than 2000 active installations. It also provides official compatibility with the following third-party plug-ins:

  • Easy Digital Downloads
  • Imagify Image Optimizer
  • ShortPixel Image Optimizer
  • WPForms
  • WP Smush
  • Advanced Custom Fields Image Crop Addon
  • SiteOrigin Widget Bundle
  • SiteOrigin CSS
  • Gravity Forms
  • WPBakery Page Builder

just because the plug-in is not listed above does not mean it cannot be used with the integration. These are just plug-ins that the UsabilityDynamics team spends extra time fixing bugs and confirming compatibility.

step 1

to install the free WP-Stateless plug-in, you can download it from the WordPress plug-in library, or search for “WP-Stateless” under “install plug-in” in the WordPress dashboard. Click install now and enable it.

How to migrate WordPress Media to Google Cloud Storage illustrations3

installs the WP-Stateless WordPress plug-in

step 2

Click “Begin Setup Assistant”. Or you can follow their manual setup instructions.

How to migrate WordPress Media to Google Cloud Storage illustrations4

WP-Stateless

step 3

Click “Google Login”. You should use the Google account you want to associate with this site and agree to the permission request. If you are not sure whether to grant access to your Google account, review their documentation on permission requests. If you do not want to provide access to your Google account, you can use the manual setup process at any time.

How to migrate WordPress Media to Google Cloud Storage illustrations5

WP-Stateless Google logs in to

step 4

Click “Allow” to let them view and manage your data in the Google Cloud Platform service. Note: once the user login process is complete, they will not retain any tokens or access credentials.

How to migrate WordPress Media to Google Cloud Storage illustrations6

Google account permissions request

step 5

then WP-Stateless will help you configure the Google Cloud project and Bucket that will store WordPress media files.

  • Google Cloud Project: each Google Cloud Bucket is contained in a project. You can create a new project or select from one of the existing projects.
  • Google Cloud Bucket: all your WordPress data is stored in one Bucket. You can create a new Bucket or choose from an existing Bucket.
  • Google Cloud Bucket Multi-Regional Location: your newly created Bucket will be equipped with multiple area storage classes. Select the area closest to most visitors to your site.
  • Google Cloud Billing: if you do not have a settlement account, click the button to set it up. Don’t forget that they offer a $300 free trial for three months.

Tip: if you want to use your own custom field or CDN URL for Google Cloud Storage, be sure to name your Bucket exactly the same as your CDN domain URL. Bucket name:gcs.yourdomain.com. It will give you a warning about characters, but periods can be used in Bucket names. It must begin and end with an alphanumeric character. After the

How to migrate WordPress Media to Google Cloud Storage illustrations7

WP-Stateless project and Bucket

have configured all of the above, click continue. Then you should see a confirmation that everything is set up correctly.

How to migrate WordPress Media to Google Cloud Storage illustrations8

WP-Stateless Settings

WP-Stateless plugin Google Cloud Storage Settings

you can find WP-Stateless and Google Cloud Storage settings under “Media → Stateless Settings”. Under the Settings tab, you need to configure the mode you like.

  • Disabled: disable stateless media.
  • Backup: upload the media file to the Google store and provide the local file URL.
  • CDN: copy media files to Google storage and provide services directly from there.
  • Stateless: only Google Cloud Storage is used to store and provide media files. Media files are not stored locally. This option will save you the most disk space.
  • File URL Replacement: scan the article content and metadata during the presentation and replace the local media file URL with Google Cloud Storage URL. This setting does not modify your database. Is

How to migrate WordPress Media to Google Cloud Storage illustrations9

WP-Stateless mode

worried about getting your media files later? Don’t worry, the plug-in has synchronization (we’ll discuss it further below) in case you want to restore it. You can also get the WordPress upload folder from Google Cloud Storage bucket itself at any time, because it only mimics the exact appearance of the library (shown below). The

How to migrate WordPress Media to Google Cloud Storage illustrations10

Google Cloud Storage WordPress bucket folder

is at the bottom of the page, and you have other settings:

  • Cache-Control: by default, it is set to:public, max-age=36000, must-revalidate. You can override it if necessary.
  • Delete GSC File: enable this option if you want to delete a file from GSC when you delete it from the WordPress library.
  • File URL and Domain: replace the default GCS domain with your own custom domain. This will require you to configure CNAME. Please note that the bucket name and domain name must match exactly. According to their documentation, the custom field does not support HTTPS, but it works well for us.
  • Organization: organize uploads into year-and month-based folders.
  • Cache Busting: add a random set of numbers and letters before the file name. This is useful for preventing caching problems when uploading files with the same file name.

How to migrate WordPress Media to Google Cloud Storage illustrations11

WP-Stateless additional settings

the images you upload to the WordPress library are automatically copied to Google Cloud Storage. However, after you configure the plug-in for the first time, you will need to run bulk synchronization. Under Media → Stateless Settings → Sync, you have the following options:

  • regenerates all stateless images and synchronizes Google Storage with the local server. (note: it takes a while to use this option for the first time.)
  • synchronizes non-image files between Google Storage and the local server.
  • synchronizes non-media library files between Google Storage and the local server.

How to migrate WordPress Media to Google Cloud Storage illustrations12

WP-Stateless synchronizes

WP Offload Media’s WordPress Google Cloud Storage Settings

the second option for integrating Google Cloud Storage with WordPress sites is to use Delicious Brains Inc. The same excellent free WP Offload Media Lite plug-in (or advanced WP Offload Media) is provided. The

How to migrate WordPress Media to Google Cloud Storage illustrations13

WordPress plug-in WP Offload Media

stripped-down version of WP Offload Media will definitely meet most of your needs; however, if you upgrade to an advanced version, there are some nice features:

  • PriorityExpert ™email support.
  • uploads existing media libraries to cloud storage.
  • controls cloud storage files from the library.
  • removes files from the server after background uninstallation.
  • is downloaded and removed from the cloud storage.
  • copies files between buckets on your storage provider in the background.
  • uses Assets Pull Addon to provide site resources (CSS, JS, images, fonts, etc.) from CloudFront or other CDN with just a few clicks.
  • integrates with WooCommerce, WPML, Easy Digital Downloads, Meta Slider, Enable Media Replace, and Advanced Custom Fields.

step 1

to install the free WP Offload Media Lite plug-in, you can download it from the WordPress plug-in library, or search for “WP Offload Media Lite” under “install plug-in” in the WordPress dashboard. Click install now and enable it.

How to migrate WordPress Media to Google Cloud Storage illustrations14

install the WP Offload Lite WordPress plug-in

step 2

follow their Google Cloud Storage Quick start instructions:

  • logs in to the Google Cloud Platform (GCP) console
  • creates a service account key file for GCS
  • saves service account key file details
  • activate your WP Offload Media license
  • configuration WP Offload Media
  • migrate your existing media library

Google Cloud Storage CDN set Is Cheng

worried about the performance of Google’s cloud storage? Indeed, multiarea storage is not at all as fast as a normal CDN, and it is definitely not good for global users. However, you can still transfer files through your favorite CDN provider. Here are a few different options.

uses KeyCDN to configure WP-Stateless

simply by following these steps, and we will use KeyCDN as an example.

important tip: this does mean that both Google Cloud Storage and your CDN provider will charge you, so you may need to process these numbers in advance. Or, if you are using a trial version of Google Cloud Platform, this is a good way to estimate costs without charging for Google.

  1. Set up a new area specifically for your Google Cloud Storage media. Follow KeyCDN’s Google Cloud Storage CDN integration tutorial. In essence, you use Google Cloud Storage as your source server.
  2. deploys Let’s Encrypt for HTTPS on the new area.
  3. sets a new zone alias in KeyCDN. Example:gcs.yourdomain.com.
  4. uses your regional alias in the WP-Stateless plug-in settings. The result of

is that KeyCDN is now delivering all your Google Cloud Storage files. Performance problem solved!

How to migrate WordPress Media to Google Cloud Storage illustrations15

Google Cloud Storage and KeyCDN

since the WP-Stateless plug-in only deals with your media library (images), you may also want to provide your scripts (JS, CSS) through CDN. Just follow these steps.

  1. uses your CDN provider to configure a separate area for your assets and uses a different URL than above, such as WordPress CDN plug-ins excluded bycdn.yourdomain.com.
  2. installation support: CDN enabler (free), Perfmatters (paid), or WP Rocket (paid).
  3. sets exclusions so that your CDN plug-in loads only CSS, JS, and so on. This way the WP-Stateless plug-in handles your media files, while the CDN plug-in handles your other resources. The end result of the CDN exclusion

How to migrate WordPress Media to Google Cloud Storage illustrations16

in

Perfmatters is that your media is loaded from your custom CDN URL (extracted from Google Cloud Storage) and your assets are loaded from your other custom CDN URL. If you run in “Stateless” mode, your WordPress site will not use any disk space for images. Cool!

How to migrate WordPress Media to Google Cloud Storage illustrations17

Google Cloud Storage and CDN combination

uses Google Cloud CDN to configure WP Offload Media

by default, WP Offload Media is configured to use the original Google Cloud Storage URL when providing uninstall media. Your media URL may be as follows:

http://storage.googleapis.com/bucket-name/wp-content/uploads/ …

check out their tutorials on how to set up a custom field CDN for Google Cloud Storage.

Disclaimer: All articles on this website, unless otherwise specified or marked, are original and published on this website. Any individual or organization is prohibited from copying, stealing, collecting, or publishing the content of this site to any website, book, or other media platform without the consent of this site. If the content on this website infringes on the legitimate rights and interests of the original author, you can contact us for assistance.