Title: Offload MP3 files only
Last modified: February 3, 2023

---

# Offload MP3 files only

 *  Resolved [nclafave](https://wordpress.org/support/users/nclafave/)
 * (@nclafave)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/offload-mp3-files-only/)
 * Is it possible to offload MP3 files ONLY with this plugin?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * (@deliciousbrains)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/offload-mp3-files-only/#post-16447483)
 * Yep, with the `as3cf_pre_upload_attachment` filter.
 * [https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks/blob/beb2e0f1bba71be7b462a60209e5ff630a57437e/amazon-s3-and-cloudfront-tweaks.php#L528](https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks/blob/beb2e0f1bba71be7b462a60209e5ff630a57437e/amazon-s3-and-cloudfront-tweaks.php#L528)
 * The above example stops movies from being offloaded, you can turn it on its head
   and replace this line…
 * `if ( is_string( $extension ) && in_array( $extension, array( 'mp4', 'mov' ) )){`
 * … with …
 * `if ( is_string( $extension ) && ! in_array( $extension, array( 'mp3' ) ) ) {`
 * I’ve left the array bit in just in case you decide to add other types of audio
   files.
 * You could do something else such as get the mime type and only offload any type
   where the first part is “audio” etc.
 * -IJ

Viewing 1 replies (of 1 total)

The topic ‘Offload MP3 files only’ is closed to new replies.

 * ![](https://ps.w.org/amazon-s3-and-cloudfront/assets/icon-256x256.jpg?rev=1809890)
 * [WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage](https://wordpress.org/plugins/amazon-s3-and-cloudfront/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-s3-and-cloudfront/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/offload-mp3-files-only/#post-16447483)
 * Status: resolved