I have created a multisite network but I’ve noticed people are uploading a lot of image files which are clogging up my server space.
Is there a way I can amend the default network theme (Users are limited to using 1 standard theme) so that all images are uploaded to my S3 account and then displayed as per usual in the WordPress media uploader?
I want to be able to do this automatically as oppose to having all my network’s users having to install a plugin manually as some of them aren’t exactly tech savvy.
If you are running on a dedicated linux server and are comfortable with the command line, you could install s3fs. This is a program that allows you to actually mount your Amazon s3 Bucket as a directory on you server.
In the standard multisite environment, media uploads for all sites but the main site are stored in the blogs.dir directory inside the wp-content directory. I am currently running a multisite installation where the blogs.dir IS my mounted s3 bucket. Here’s an overview…
As with anything, there are pros and cons to this setup.
The pros are that whenever a user uploads a media file to their multisite, it is being directly stored on your s3 bucket. And when the media is called for, it is being pulled from the bucket. Also, when a user edits an image inside the WordPress admin, the changes are again being stored directly in your s3 bucket.
The cons are that it does make the upload new file interface a bit slower on the backend, and it may make reading the files a little slower also (unless you can use .htaccess rewrite rules in apache to redirect the media url’s directly to s3, which is possible, but beyond the scope of this answer).
Hope this helps. Visit the s3fs for documentation on how to install and use s3fs.