As an example, you already have a bucket named my-awesome-site
but you want all of your media to go into a preprod
subdirectory of that bucket. To configure media to upload to that subdirectory, go to the S3 Media Sync settings page and enter the following for the S3 Bucket Name
field:
my-awesome-site/preprod
Then, all media will automatically be kept in-sync within my-awesome-site/preprod/wp-content/uploads
.
You can check which attachments were skipped by running the following command:
wp vip migration validate-attachments invalid-attachments.csv --url=example-site.com
The generated log file will be available at invalid-attachments.csv
. The full command can be found in the VIP Go MU plugins repository.
If you're experiencing issues connecting to your S3 bucket:
- Verify your AWS credentials are correct
- Ensure your IAM user has the correct permissions as outlined in the AWS Setup Guide
- Check that your bucket name and region are entered correctly
- Use the "Test S3 Access" button on the settings page to diagnose connection issues
When you delete a media file in WordPress, S3 Media Sync automatically deletes that file from your S3 bucket as well. This includes:
- The original file
- All generated thumbnails and image sizes
- Any related files with similar filenames in the same directory
This keeps your S3 bucket in sync with your WordPress media library and prevents orphaned files from accumulating in your bucket. The deletion happens immediately when you delete media through the WordPress media library.
If you need to manually remove files from S3, you can also use the WP-CLI command:
wp s3-media rm path/to/file.jpg