Verification
Now let’s verify if the plugin is working properly and new new images are being served from Google Cloud storage.
- Go to Media and normally upload an image
- Click on the image after it is uploaded
- 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.
Let’s also verify it from the Google Cloud Console.
- Login to Google Cloud Console
- Go to Cloud Storage
- Click on your bucket name, like cat-images-bucket
- Keep opening the folders
- For example: /wp-content/uploads/2023/11/15205759
- You will see a bunch of files
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.
Contact Us