What is a MIME type in WordPress?

WordPress Core

A MIME type (Multipurpose Internet Mail Extensions type) is a standard identifier that tells browsers and servers what kind of file they are handling. WordPress uses MIME types to validate uploads, determine which files are allowed, and decide how to process and display them.

How MIME types work in WordPress

When you upload a file, WordPress checks its MIME type against a list of allowed types. Common image MIME types are image/jpeg, image/png, image/gif, image/webp and image/avif. Documents use types like application/pdf. Audio and video have their own types.

WordPress stores the MIME type of each attachment in the wp_posts table (the post_mime_type field). This is used for filtering in the Media Library — when you filter by Images or Audio or Video, WordPress queries by MIME type.

MIME types and format conversion

When Mediapapa converts an image to WebP or AVIF, the stored MIME type updates from image/jpeg or image/png to image/webp or image/avif. The attachment ID stays the same. Any reference to the file continues to work — the MIME type change is transparent to the content that uses the file.

Frequently asked questions

Why does WordPress sometimes reject a valid file upload?

WordPress validates uploads by checking the file extension and MIME type. If the two do not match (for example, a PNG file renamed with a .jpg extension), WordPress may reject the upload. Some hosting environments also restrict certain MIME types at the server level.

Can I add new MIME types to WordPress?

Yes, using the upload_mimes filter in PHP. This is how SVG support is added — SVG is not in WordPress’s default allowed list because it can contain executable code. Plugins like Safe SVG handle this safely.

Related terms: AVIF · WebP · Image Optimisation