HTTP/2 302
server: nginx
date: Sat, 11 Oct 2025 11:52:37 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0, no-store, private
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/hooks/upload_mimes/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sat, 11 Oct 2025 11:52:37 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
upload_mimes – Hook | Developer.WordPress.org
apply_filters( ‘upload_mimes’, array $t, int|WP_User|null $user )
Filters the list of allowed mime types and file extensions.
$t
arrayMime types keyed by the file extension regex corresponding to those types.
$user
int|WP_User|nullUser ID, User object or null if not provided (indicates current user).
Version | Description |
---|
2.0.0 | Introduced. |
Add MIME types.
And if you want to know what is your real file mime type, you can use this service: https://wp-check-mime-type.com/.
(example taken from @dotmastaz’s feedback)
Allow SVGZ mime type:
And if you want to know what is your real file mime type, you can use this service: https://wp-check-mime-type.com/.
Filter the upload mime types to allow JSON files.
Allow CSV file type.
Allow uploading fonts files.
If you work locally, for example on XAMPP, you should also include extension=gd in php.ini, just uncomment it, removing ; in front of it.