How to reset WP Offload S3 when your S3 bucket has changed

I am a fan of speed optimisation and also like to tinker with WP Offload S3 by delicious brains. Recently I found myself in the need of reseting the media library uploads.

I had cleared my old S3 bucket and created a new one, however WP Offload S3 still insisted on the old bucket. To reset WP Offload S3 and make it forget the old bucket, do the following.

  • Take a full backup of your database
  • Offload S3 media stores the name of the bucket in full in the wp-postmeta┬átable. This value is set for every uploaded media file.
  • Do a search for “full-bucket-name”. It will find the value in the wp-postmeta table and some other places.
  • Drop all the values found in the wp-postmeta table.
  • This does the same as using the “remove from S3” option in the media library.
  • For good measure you can delete all traces you find of the old bucket name in other tables as well. It should do no harm and if it does, you did take that backup, right?

After this your Offload S3 is ready to start fresh and prompts you to upload all your media files.

Leave a Reply

Your email address will not be published. Required fields are marked *