Title: wp_editor_set_quality
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘wp_editor_set_quality’, int $quality, string $mime_type, array $size )

## In this article

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

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

Filters the default image compression quality setting.

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

Applies only during initial editor instantiation, or when set_quality() is run manually
without the `$quality` argument.

The [WP_Image_Editor::set_quality()](https://developer.wordpress.org/reference/classes/wp_image_editor/set_quality/)
method has priority over the filter.

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

 `$quality`int

Quality level between 1 (low) and 100 (high).

`$mime_type`string

Image mime type.

`$size`array

Dimensions of the image.

 * `width` int
 * The image width.
 * `height` int
 * The image height.

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

    ```php
    $quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type, $dims ? $dims : $this->size );
    ```

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

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

| Used by | Description | 
| [WP_Image_Editor::set_quality()](https://developer.wordpress.org/reference/classes/wp_image_editor/set_quality/)`wp-includes/class-wp-image-editor.php` |

Sets Image Compression quality on a 1-100% scale.

  |

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

| Version | Description | 
| [6.8.0](https://developer.wordpress.org/reference/since/6.8.0/) | Added the size parameter. | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |

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

 1.   [Skip to note 5 content](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/?output_format=md#comment-content-88)
 2.    [Tom Auger](https://profiles.wordpress.org/tomauger/)  [  12 years ago  ](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-88)
 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%2Fwp_editor_set_quality%2F%23comment-88)
     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%2Fwp_editor_set_quality%2F%23comment-88)
 4.  This sets the default compression quality used in [WP_Image_Editor](https://developer.wordpress.org/reference/classes/wp_image_editor/),
     the class used for manipulating images. Do note that the if the image is a JPEG
     image (mime type == ‘image/jpeg’) this filter is superceded by the [jpeg_quality](https://developer.wordpress.org/reference/hooks/jpeg_quality-2/)
     filter and effectively will not be used.
 5.   * The link in Tom Auger’s post above for jpeg_quality is broken. The current 
        link is: [https://developer.wordpress.org/reference/hooks/jpeg_quality/](https://developer.wordpress.org/reference/hooks/jpeg_quality/)
      * [SherylHohman](https://profiles.wordpress.org/sherylhohman/) [6 years ago](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-3463)
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_editor_set_quality%2F%3Freplytocom%3D88%23feedback-editor-88)
 7.   [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/?output_format=md#comment-content-7298)
 8.    [golden_g73](https://profiles.wordpress.org/may73alliance/)  [  1 year ago  ](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-7298)
 9.  [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%2Fwp_editor_set_quality%2F%23comment-7298)
     Vote results for this note: 0[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%2Fwp_editor_set_quality%2F%23comment-7298)
 10. Default image quality is 90 for WEBP and AVIF.
 11. [https://github.com/WordPress/wordpress-develop/blob/6.7/src/wp-admin/includes/image-edit.php#L390](https://github.com/WordPress/wordpress-develop/blob/6.7/src/wp-admin/includes/image-edit.php#L390)
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_editor_set_quality%2F%3Freplytocom%3D7298%23feedback-editor-7298)
 13.  [Skip to note 7 content](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/?output_format=md#comment-content-7400)
 14.   [Lovro Hrust](https://profiles.wordpress.org/lovor/)  [  6 months ago  ](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-7400)
 15. [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%2Fwp_editor_set_quality%2F%23comment-7400)
     Vote results for this note: 0[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%2Fwp_editor_set_quality%2F%23comment-7400)
 16. Since there is no way to remove past comment – I have to correct this one, webp
     default quality is now set to 90, as commenters above had mention.
 17.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_editor_set_quality%2F%3Freplytocom%3D7400%23feedback-editor-7400)
 18.  [Skip to note 8 content](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/?output_format=md#comment-content-6259)
 19.   [Lovro Hrust](https://profiles.wordpress.org/lovor/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-6259)
 20. [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%2Fwp_editor_set_quality%2F%23comment-6259)
     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%2Fwp_editor_set_quality%2F%23comment-6259)
 21. Default quality for webp image (`image/webp`) is 86.
 22.  * disregard this comment, it is obsolete
      * [Lovro Hrust](https://profiles.wordpress.org/lovor/) [6 months ago](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/#comment-7401)
 23.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_editor_set_quality%2F%3Freplytocom%3D6259%23feedback-editor-6259)

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