Configure R2 object cleanup rules in WHMCS
Use PD Cloudflare R2’s lifecycle editor to expire selected objects or abandon unfinished multipart uploads automatically. These are bucket cleanup rules, separate from the module’s retention period after service termination.
Plan the complete rule set
Open the service’s Storage settings, select the intended bucket and inspect the existing rules. Saving replaces the complete lifecycle rule set for that bucket. Keep any needed housekeeping rule, including unfinished-upload cleanup; an empty saved set can clear it.
Decide the object prefix and age deliberately. A broad or blank prefix can match more files than intended. R2 does not provide S3 object versioning, so an expired current object cannot be recovered as an older version through this module.
Save and inspect the rules
- Add the supported rule and its object prefix.
- Set the intended current-object expiration and/or unfinished multipart-upload age.
- Review all enabled rules together, including existing cleanup that must remain.
- Save once and reopen the bucket settings to verify the full rule set.
- Check the later provider result rather than expecting objects to disappear immediately.
The editor supports up to twenty rules and the controls it actually displays. Native R2 has additional lifecycle capabilities; do not assume a native storage-class transition is configurable through this module’s simple editor. Cloudflare’s lifecycle reference explains provider processing.
Keep recovery separate
Maintain an independent backup or recovery copy before enabling destructive expiration. A cancellation-retention window does not restore files a bucket lifecycle rule already deleted.
For a refused save, preserve the previous rule set and review the reported bucket error before changing it. Do not repeatedly submit an empty replacement or shorten expiration to force a result.
See the PD Cloudflare R2 WHMCS guide for related tasks, or explore the module.