Title: wp_prevent_unsupported_mime_type_uploads
Published: April 28, 2025
Last modified: August 20, 2026

---

# apply_filters( ‘wp_prevent_unsupported_mime_type_uploads’, bool $check_mime, string|null $mime_type )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#changelog)

Filter whether the server should prevent uploads for image types it doesn’t support.
Default true.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#description)󠁿

Developers can use this filter to enable uploads of certain image types. By default
image types that are not supported by the server are prevented from being uploaded.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#parameters)󠁿

 `$check_mime`bool

Whether to prevent uploads of unsupported image types.

`$mime_type`string|null

The mime type of the file being uploaded (if available).

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#source)󠁿

    ```php
    $prevent_unsupported_uploads = apply_filters( 'wp_prevent_unsupported_mime_type_uploads', true, $files['file']['type'] ?? null );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php#L440)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php#L440-L440)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_REST_Attachments_Controller::create_item_permissions_check()](https://developer.wordpress.org/reference/classes/wp_rest_attachments_controller/create_item_permissions_check/)`wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php` |

Checks if a given request has access to create an attachment.

  | 
| [media_upload_form()](https://developer.wordpress.org/reference/functions/media_upload_form/)`wp-admin/includes/media.php` |

Outputs the legacy media upload form.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_prevent_unsupported_mime_type_uploads/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.8.0](https://developer.wordpress.org/reference/since/6.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_prevent_unsupported_mime_type_uploads%2F)
before being able to contribute a note or feedback.