Verification

Now let’s verify if the plugin is working properly and new new images are being served from Google Cloud storage.

  1. Go to Media and normally upload an image
  2. Click on the image after it is uploaded
  3. See File URL in the description

If the URL starts with <bucket-name>.storage.googleapis.com, the image has successfully been upload to the bucket.

The image has been uploaded to Google Cloud Storage

Let’s also verify it from the Google Cloud Console.

  1. Login to Google Cloud Console
  2. Go to Cloud Storage
  3. Click on your bucket name, like cat-images-bucket
  4. Keep opening the folders
    • For example: /wp-content/uploads/2023/11/15205759
  5. You will see a bunch of files

The cat image has been uploaded to the bucket

Integrating Google Cloud Storage with WordPress: Storing Media Files

Now, before learning how to integrate Google Cloud Storage with WordPress, let’s try and understand why you might want to do that. To answer our question, let’s imagine that you have built an awesome cat website that allows users to share pics of their cats. The website is getting popular, I mean who doesn’t like cats? Slowly, thousands of users are uploading their cat pics and you have to store GB’s of cat images daily. Now, how would you store all the images? In a normal WordPress setup, your server disk would fill up soon. What would you do next? Add more disks? How long would you keep doing it?

Simply adding more disks to your server would not be feasible because of two reasons: cost and performance. General block storage is generally more expensive, and traversing through large storage will also impact your performance negatively.

Among the many different solutions, one is managed object storage. How about we offload all the images to something like Google Cloud Storage and load them into our website directly from there? It will generally be cheaper and will also not slow down our server.

Now that you know the reason, let’s learn how to offload images and videos from WordPress to Google Cloud Storage, which is a managed object storage service. We are going to use a plugin called WP Offload Media Lite.

Similar Reads

Google Cloud Storage

Google Cloud Storage is an S3 compatible object storage service. Object storage is scalable, durable, and secure. Once we store our data in object storage it can be accessed from anywhere, which means the object storage is region independent. You can read more about it here....

How to Integrate Google Cloud Storage with WordPress: Storing Media Files

Step 1: Install WP Offload Media Lite...

Verification

...

Conclusion

Now let’s verify if the plugin is working properly and new new images are being served from Google Cloud storage....

Frequently Asked Questions

WP Offload Media Lite is one of the most trusted plugins that you can use to offload media to not just Google Cloud Storage but other providers like AWS too. You can also use the plugin WP-Stateless for it....