Deleting multiple objects - Amazon Simple Storage Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Deleting multiple objects

Because all objects in your S3 bucket incur storage costs, you should delete objects that you no longer need. For example, if you are collecting log files, it's a good idea to delete them when they're no longer needed. You can set up a lifecycle rule to automatically delete objects such as log files. For more information, see Setting lifecycle configuration on a bucket.

For information about Amazon S3 features and pricing, see Amazon S3 pricing.

You can use the Amazon S3 console, Amazon SDKs, or the REST API to delete multiple objects simultaneously from an S3 bucket.

Follow these steps to use the Amazon S3 console to delete multiple objects from a bucket.

To delete objects
  1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at https://console.amazonaws.cn/s3/.

  2. Navigate to the Amazon S3 bucket or folder that contains the objects that you want to delete.

  3. Select the check box to the left of the names of the objects that you want to delete.

  4. Choose Actions and choose Delete from the list of options that appears.

    Alternatively, choose Delete from the options in the upper right.

  5. Enter delete or permanently delete when asked to confirm that you want to delete these objects.

  6. Choose Delete objects in the bottom right and Amazon S3 deletes the specified objects.

Warning
  • Deleting a specified object cannot be undone.

  • This action deletes all specified objects. When deleting folders, wait for the delete action to finish before adding new objects to the folder. Otherwise, new objects might be deleted as well.

  • When deleting an object in a bucket without versioning enabled, Amazon S3 will permanently delete the object.

  • When deleting an object in a bucket with bucket versioning enabled or suspended, Amazon S3 creates a delete marker. For more information, see Working with delete markers.

For examples of how to delete multiple objects with the Amazon SDKs, see Delete multiple objects from an Amazon S3 bucket using an Amazon SDK.

For general information about using different Amazon SDKs, see Developing with Amazon S3 using the Amazon SDKs, and explorers.

You can use the Amazon SDKs to delete multiple objects using the Multi-Object Delete API. However, if your application requires it, you can send REST requests directly.

For more information, see Delete Multiple Objects in the Amazon Simple Storage Service API Reference.