In today’s tips and tricks article I wanted to take a look at a way for WordPress users to both speed up their website performance while saving valuable space on their web host as well.
Many of the web hosts on the market today limit the amount of disk storage available to your account, especially if you subscribe to cloud hosting or WordPress optimized hosting services. When faced with a storage restriction of say 10GB, you can quickly use up this space with your website media, especially if you post frequently with media rich articles, are running an eCommerce website, or provide downloadable content.
Thankfully, you can offload your WordPress assets to a cloud provider such as Amazon S3, Google Cloud Storage, DigitalOcean spaces or Wasabi. Today, I am going to show you how I offloaded my WordPress assets to my Wasabi storage account using the plugin Media Cloud.
Step One – Signup for Wasabi
If you haven’t already, head over to Wasabi and sign up for an account, you get a 30 day free trial if you are a new client, so even if you are just testing the waters with this solution, it will cost you nothing. The thing I like about Wasabi is that you get 1TB of online storage, with unlimited egress for a flat $5.99 per month after your trial, plus, Wasabi provides high availability, it is super fast and its 80% less than S3 storage. Go to Wasabi.
After you have completed registration (or if you already have a Wasabi account) create a new bucket for your WordPress assets by clicking on the ‘Create Bucket’ button in the top right of your console.
When the Create Bucket dialog box opens, simply provide a name for your new bucket and select a region (we are using US East 1). You can leave the rest of the options default, and select the Create Bucket button at the bottom of the form on step one.
You will see your new bucket in the bucket list of your Wasabi console and you are now ready to move on to setting up the WordPress plugin.
Step Two – Setup Media Cloud
Access your WordPress dashboard and go to Plugins>Add New and search for Media Cloud. For information about Media Cloud go here. Click on the Install Now button and once installed click on Activate. Once activated you will see a new entry in your WordPress dashboard menu for Media Cloud. Before we get started with the settings for Media Cloud, we need to create a user and get the API keys for that user in Wasabi.
Switch back to your Wasabi console and click on the menu stack icon in the upper left to reveal the console navigation. Click on Users to open the control module for users and then select the Create User button at the top. The Add User dialog box will appear where you need to enter a user name and then select Programmatic (create API key) option at the bottom. Click the next button.
In step two you have the ability to add the user to a group, I suggest creating a WordPress group within your Wasabi console. To do so, simply create the Create A New Group button and type your desired group name, click on Save and then click on the next button.
In the policies section of the Add User steps we can add the permissions which the new user account has. Because the user will need to both read and write I always select the WasabiFullAccess permission for the Media Cloud user account. Click on the next button.
The final step of the Add User wizard is a review of your choices, make sure the username, group and permissions are correct and click on the Create User button. You will be presented with a confirmation screen which will have your Access Key and Secret Key for the new user. We will need both of these for the Media Cloud setup, so copy them over to a text file or download the csv file provided.
Now that we have created our Wasabi bucket and have a new Wasabi user setup for API access, its time to complete the Media Cloud setup. Hover your mouse over the Media Cloud item in your WordPress dashboard menu and from the pop-out menu select Settings.
On the settings screen, first toggle Enable Cloud Storage, then select Wasabi from the storage provider drop down box, then insert the Access Key in the Access Key box, followed by your secret key in the Secret box. In the Bucket box, type out the name of the storage bucket you created earlier, and then select the region in which your bucket is located in the drop down box below.
Scroll down to the Upload Handling section and select the options that make sense for your particular needs. I suggest that you set the Upload Privacy to public read, enable Upload Non-Image files (this will send any documents you upload to Wasabi as well), and enable Delete Uploaded Files (this will remove files from the hosting server after they have been off-loaded to Wasabi).
Finally, scroll down to the Display Settings section and enable both options so that you can see in the Media Manager the items which are stored in Wasabi, and view the information in WordPress about those items. Scroll to the bottom and click Save Changes.
Now we have go to the Features section of Media Cloud – hover over the Media Cloud menu option and select Features from the pop-out menu. Make sure that Cloud Storage (first option) is toggled on (this generally is toggled automatically after setting up the storage settings, but always double check). Now that we have enabled storage and setup our cloud storage location, it is time to off-load all our assets to the cloud!
From the Media Cloud menu, click on the Migrate To Cloud option. From the Migrate to Cloud screen, select the option to Skip Imported Items (this will ignore items that already have been uploaded to the cloud) and simply click on the Import Uploads button at the bottom.
Media Cloud will now migrate all of your images to the Wasabi cloud storage. You will see a progress bar showing the images that have been uploaded. Once completed, you can jump over to your Wasabi console and click on the bucket you created for your WordPress site and will see a file structure just like the WordPress upload directory on your hosting service. If you click into the directories you will see all of the assets uploaded to the cloud. You can also click on Media from your WordPress dashboard menu and all of your images will now have a little cloud icon and if you click on an image the info section will give you the Wasabi URL for that asset.
Now that you have confirmed that your images have all transferred, the final remaining task is to remove the images from your web hosting provider. Now, any images uploaded from this point on will automatically be uploaded to Wasabi and removed from the web host, however we have to remove the images that existed before setting up Media Cloud.
To remove the previous uploads, simply navigate to your web host and use their file manager to remove the items within your upload directory, or use an FTP utility such as FileZilla to FTP to your server and remove the files.
That’s it! If you followed this tutorial from the beginning you have now completed setup of Media Cloud and are now successfully off-loading your assets to Wasabi.