Title: wp_min_priority_img_pixels
Published: August 8, 2023
Last modified: May 20, 2026

---

# apply_filters( ‘wp_min_priority_img_pixels’, int $threshold )

## In this article

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

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

Filters the minimum square-pixels threshold for an image to be eligible as the high-
priority image.

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

 `$threshold`int

Minimum square-pixels threshold. Default 50000.

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

    ```php
    $wp_min_priority_img_pixels = apply_filters( 'wp_min_priority_img_pixels', 50000 );
    ```

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

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

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

Gets loading optimization attributes.

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

Determines whether to add `fetchpriority='high'` to loading attributes.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/wp_min_priority_img_pixels/?output_format=md#comment-content-6656)
 2.   [Khokan Sardar](https://profiles.wordpress.org/khokansardar/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/wp_min_priority_img_pixels/#comment-6656)
 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_min_priority_img_pixels%2F%23comment-6656)
    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_min_priority_img_pixels%2F%23comment-6656)
 4. Filter minimum square-pixels threshold value for small thumbnail images that appear
    in lists or grids, a minimum of 200×200 pixels might be suitable.
 5.     ```php
        /**
         * Filters to set the minimum square-pixels threshold for an image to be eligible as the high-priority image.
         *
         * @param int  $threshold Minimum threshold value.
         * @return int $threshold Modified threshold value.
         */
        function set_min_priority_img_pixels( $threshold ){
            // Set minimum threshold of 200x200 pixels for small thumbnail images.
            $threshold = 40000;
            return $threshold;
        }
        add_filter( 'wp_min_priority_img_pixels', 'set_min_priority_img_pixels' );
        ```
    
 6.  * This option can end up degrading CLS by priorizing images way below the fold,
       and will priorize images in IMG tags over CSS background images
     * [Eric](https://profiles.wordpress.org/zarglu/) [3 years ago](https://developer.wordpress.org/reference/hooks/wp_min_priority_img_pixels/#comment-6834)
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_min_priority_img_pixels%2F%3Freplytocom%3D6656%23feedback-editor-6656)

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