Title: post_mime_types
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘post_mime_types’, array $post_mime_types )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#wp--skip-link--target)

Filters the default list of post mime types.

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

 `$post_mime_types`array

Default list of post mime types.

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

    ```php
    return apply_filters( 'post_mime_types', $post_mime_types );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/post.php#L3633)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post.php#L3633-L3633)

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

| Used by | Description | 
| [get_post_mime_types()](https://developer.wordpress.org/reference/functions/get_post_mime_types/)`wp-includes/post.php` |

Gets default post mime types.

  |

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/post_mime_types/?output_format=md#comment-content-6152)
 2.   [naarkz](https://profiles.wordpress.org/naarkz/)  [  4 years ago  ](https://developer.wordpress.org/reference/hooks/post_mime_types/#comment-6152)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpost_mime_types%2F%23comment-6152)
    Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpost_mime_types%2F%23comment-6152)
 4. To unset and rename some items in the dropdown filter for media items:
 5.     ```php
        function edit_post_mime_types($post_mime_types){
            $post_mime_types['application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-word.document.macroEnabled.12,application/vnd.ms-word.template.macroEnabled.12,application/vnd.oasis.opendocument.text,application/vnd.apple.pages,application/pdf,application/vnd.ms-xpsdocument,application/oxps,application/rtf,application/wordperfect,application/octet-stream'][0] = 'PDFs';   // Change Documents to PDFs only; 
            unset($post_mime_types['audio']); // Remove Audios
            unset($post_mime_types['video']); // Remove Videos
            unset($post_mime_types['application/x-gzip,application/rar,application/x-tar,application/zip,application/x-7z-compressed']); // Remove Archives
            unset($post_mime_types['application/vnd.apple.numbers,application/vnd.oasis.opendocument.spreadsheet,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel.sheet.macroEnabled.12,application/vnd.ms-excel.sheet.binary.macroEnabled.12']); // Remove Spreadsheets
    
            return $post_mime_types;
        }
    
        add_filter('post_mime_types', 'edit_post_mime_types');
        ```
    
 6. I had to resort to this because apparently, restricting all these file types using
    upload_mimes filter still doesn’t remove these items in the dropdown.
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpost_mime_types%2F%3Freplytocom%3D6152%23feedback-editor-6152)

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