Title: Ưu tiên Hình ảnh
Author: WordPress Performance Team
Published: <strong>5 Tháng 6, 2024</strong>
Last modified: 26 Tháng 8, 2026

---

Tìm kiếm plugin

![](https://ps.w.org/image-prioritizer/assets/banner-772x250.png?rev=3099535)

![](https://ps.w.org/image-prioritizer/assets/icon.svg?rev=3099535)

# Ưu tiên Hình ảnh

 Bởi [WordPress Performance Team](https://profiles.wordpress.org/performanceteam/)

[Tải về](https://downloads.wordpress.org/plugin/image-prioritizer.1.0.0-beta4.zip)

 * [Chi tiết](https://vi.wordpress.org/plugins/image-prioritizer/#description)
 * [Đánh giá](https://vi.wordpress.org/plugins/image-prioritizer/#reviews)
 *  [Cài đặt](https://vi.wordpress.org/plugins/image-prioritizer/#installation)
 * [Nhà phát triển](https://vi.wordpress.org/plugins/image-prioritizer/#developers)

 [Hỗ trợ](https://wordpress.org/support/plugin/image-prioritizer/)

## Mô tả

This plugin optimizes the loading of images (and videos) with prioritization to 
improve [Largest Contentful Paint](https://web.dev/articles/lcp) (LCP), lazy loading,
and more accurate image size selection.

The current optimizations include:

 1.  Add breakpoint-specific `fetchpriority=high` preload links (both as `LINK[rel=
     preload]` elements and `Link` response headers) for image URLs of LCP elements:
 2.   a. An `IMG` element, including the `srcset`/`sizes` attributes supplied as `imagesrcset`/`
         imagesizes` on the `LINK`.
      b. The first `SOURCE` element with a `type` attribute in a `PICTURE` element. (Art-
         directed `PICTURE` elements using media queries are not supported.)
      c. An element with a CSS `background-image` inline `style` attribute.
      d. An element with a CSS `background-image` applied with a stylesheet (when the 
         image is from an allowed origin).
      e. A `VIDEO` element’s `poster` image.
 3.  Ensure `fetchpriority=high` is only added to an `IMG` when it is the LCP element
     across all responsive breakpoints.
 4.  Add `fetchpriority=low` to `IMG` tags which appear in the initial viewport but
     are not visible, such as when they are subsequent carousel slides.
 5.  Lazy loading:
 6.   a. Apply lazy loading to `IMG` tags based on whether they appear in any breakpoint’s
         initial viewport.
      b. Implement lazy loading of CSS background images added via inline `style` attributes.
      c. Lazy-load `VIDEO` tags by setting the appropriate attributes based on whether
         they appear in the initial viewport. If a `VIDEO` is the LCP element, it gets`
         preload=auto`; if it is in an initial viewport, the `preload=metadata` default
         is left; if it is not in an initial viewport, it gets `preload=none`. Lazy-loaded
         videos also get initial `preload`, `autoplay`, and `poster` attributes restored
         when the `VIDEO` is going to enter the viewport.
 7.  Responsive image sizes:
 8.   a. Ensure [`sizes=auto`](https://make.wordpress.org/core/2024/10/18/auto-sizes-for-lazy-loaded-images-in-wordpress-6-7/)
         is set on `IMG` tags after setting correct lazy-loading (above).
      b. ~~Compute the `sizes` attribute using the widths of an image collected from URL
         Metrics for each breakpoint (when not lazy-loaded since then handled by `sizes
         =auto`).~~ (This has been removed due to an [issue](https://github.com/WordPress/performance/issues/2098);
         use [Enhanced Responsive Images instead](https://wordpress.org/plugins/auto-sizes/).)
 9.  Reduce the size of the `poster` image of a `VIDEO` from full size to the size 
     appropriate for the maximum width of the video (on desktop).

**This plugin requires the [Optimization Detective](https://wordpress.org/plugins/optimization-detective/)
plugin as a dependency.** Please refer to that plugin for additional background 
on how this plugin works as well as additional developer options.

👉 **Note:** This plugin optimizes pages for actual visitors, and it depends on 
visitors to optimize pages. As such, you won’t see optimizations applied immediately
after activating the plugin. Please wait for URL Metrics to be gathered for both
mobile and desktop visits. And since administrator users are not normal visitors
typically, optimizations are not applied for admins by default.

Your site must have the **REST API accessible** to unauthenticated frontend visitors
since this is how metrics are collected about how a page should be optimized. There
are currently **no settings** and no user interface for this plugin since it is 
designed to work without any configuration.

## Cài đặt

#### Cài đặt từ trong WordPress

 1. Hãy truy cập **Plugin > Thêm mới**.
 2. Tìm kiếm **Ưu tiên Hình ảnh**.
 3. Cài đặt và kích hoạt plugin **Ưu tiên Hình ảnh**.

#### Cài đặt thủ công

 1. Tải lên toàn bộ thư mục `image-prioritizer` vào thư mục `/wp-content/plugins/`.
 2. Truy cập **Plugin**.
 3. Kích hoạt plugin **Ưu tiên Hình ảnh**.

## Hỏi đáp

### Tôi có thể gửi phản hồi về plugin của mình ở đâu?

Phản hồi được khuyến khích và rất được hoan nghênh, đặc biệt là vì plugin này có
thể chứa các tính năng cốt lõi của WordPress trong tương lai. Nếu bạn có đề xuất
hoặc yêu cầu về tính năng mới, bạn có thể [gửi chúng dưới dạng sự cố trong kho lưu trữ GitHub của Nhóm Hiệu suất WordPress](https://github.com/WordPress/performance/issues/new/choose).
Nếu bạn cần trợ giúp về khắc phục sự cố hoặc có câu hỏi về plugin, vui lòng [tạo một chủ đề mới trên diễn đàn hỗ trợ của chúng tôi](https://wordpress.org/support/plugin/image-prioritizer/#new-topic-0).

### Tôi có thể báo cáo lỗi bảo mật ở đâu?

Nhóm Hiệu suất và cộng đồng WordPress rất coi trọng các lỗi bảo mật. Chúng tôi đánh
giá cao những nỗ lực của bạn trong việc tiết lộ có trách nhiệm những phát hiện của
mình và sẽ nỗ lực hết sức để ghi nhận những đóng góp của bạn.

Để báo cáo sự cố bảo mật, vui lòng truy cập chương trình [WordPress HackerOne](https://hackerone.com/wordpress).

### Làm cách nào để tôi có thể đóng góp cho plugin?

Chúng tôi luôn hoan nghênh các đóng góp! Tìm hiểu thêm về cách tham gia vào [Sổ tay Nhóm Hiệu suất Cốt lõi](https://make.wordpress.org/performance/handbook/get-involved/).

Mã nguồn của plugin [plugin source code](https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer)
được đặt trong kho lưu trữ [WordPress/performance](https://github.com/WordPress/performance)
trên GitHub.

## Đánh giá

![](https://secure.gravatar.com/avatar/0a58444de920fe838acbf7302c9f8678af073ba9a4482db5fe6b583eb9b3c249?
s=60&d=retro&r=g)

### 󠀁[speed boost](https://wordpress.org/support/topic/speed-boost/)󠁿

 [ivanmecina](https://profiles.wordpress.org/ivanmecina/) 17 Tháng 7, 2025

I don't know what this does but I have seen a massive speed boost from 67 to 95-
99 it would be good to have some control of the settings of fetchpriority=high

 [ Đọc tất cả 1 đánh giá ](https://wordpress.org/support/plugin/image-prioritizer/reviews/)

## Người đóng góp & Lập trình viên

“Ưu tiên Hình ảnh” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp

 *   [ WordPress Performance Team ](https://profiles.wordpress.org/performanceteam/)
 *   [ WordPress.org ](https://profiles.wordpress.org/wordpressdotorg/)

“Ưu tiên Hình ảnh” đã được dịch qua 11 ngôn ngữ. Cảm ơn [những người tham gia dịch](https://translate.wordpress.org/projects/wp-plugins/image-prioritizer/contributors)
vì đóng góp của họ.

[Dịch “Ưu tiên Hình ảnh” sang ngôn ngữ của bạn.](https://translate.wordpress.org/projects/wp-plugins/image-prioritizer)

### Muốn tham gia phát triển?

[Duyệt code](https://plugins.trac.wordpress.org/browser/image-prioritizer/), check
out [SVN repository](https://plugins.svn.wordpress.org/image-prioritizer/), hoặc
theo dõi [nhật ký phát triển](https://plugins.trac.wordpress.org/log/image-prioritizer/)
qua [RSS](https://plugins.trac.wordpress.org/log/image-prioritizer/?limit=100&mode=stop_on_copy&format=rss).

## Nhật ký thay đổi

#### 1.0.0-beta4

**Enhancements**

 * Add `declare( strict_types = 1 )` to all PHP files. ([2424](https://github.com/WordPress/performance/pull/2424))
 * Bump minimum required WordPress version to 6.9. ([2517](https://github.com/WordPress/performance/pull/2517))
 * Bump minimum required PHP version from 7.2 to 7.4. ([2469](https://github.com/WordPress/performance/pull/2469))
 * Improve code quality with native property types and stricter static analysis.(
   [1729](https://github.com/WordPress/performance/pull/1729))

**Bug Fixes**

 * Fix TypeScript 6 type errors in the video lazy-loading script. ([2434](https://github.com/WordPress/performance/pull/2434))

#### 1.0.0-beta3

**Enhancements**

 * Add URL Metric mutation helpers to extension initialization API. ([1951](https://github.com/WordPress/performance/pull/1951))
 * Improve construction of inline scripts with `sourceURL`, hardened JSON encoding,
   and exporting JSON in separate script. ([2169](https://github.com/WordPress/performance/pull/2169))

**Bug Fixes**

 * Allow background image URLs for file types the web server doesn’t know about,
   e.g. when AVIF is sent as `application/octet-stream`. ([1956](https://github.com/WordPress/performance/pull/1956))
 * Remove responsive image sizes computation. ([2109](https://github.com/WordPress/performance/pull/2109))

#### 1.0.0-beta2

**Enhancements**

 * Update `OD_HTML_Tag_Processor::next_tag()` to allow `$query` arg and prepare 
   to skip visiting tag closers by default. ([1872](https://github.com/WordPress/performance/pull/1872))
 * Expose the logging functions to client-side extensions and automatically account
   for the value of `isDebug`. ([1895](https://github.com/WordPress/performance/pull/1895))

**Bug Fixes**

 * Fix URL encoding in Link HTTP response header. ([1907](https://github.com/WordPress/performance/pull/1907))
 * Fix unpredictable LCP element being identified in a URL Metric Group. ([1903](https://github.com/WordPress/performance/pull/1903))

#### 1.0.0-beta1

**Enhancements**

 * Bump version to 1.0.0-beta1 to indicate graduation from being experimental. See
   [1846](https://github.com/WordPress/performance/pull/1846).
 * Compute responsive `sizes` attribute based on the `width` from the `boundingClientRect`
   in captured URL Metrics. ([1840](https://github.com/WordPress/performance/pull/1840))

#### 0.3.1

**Bug Fixes**

 * Remove erroneous check for resource initiator type when considering whether to
   submit LCP background image. ([1760](https://github.com/WordPress/performance/pull/1760))

#### 0.3.0

**Enhancements**

 * Add preload links LCP picture elements. ([1707](https://github.com/WordPress/performance/pull/1707))
 * Harden validation of user-submitted LCP background image URL. ([1713](https://github.com/WordPress/performance/pull/1713))
 * Lazy load background images added via inline style attributes. ([1708](https://github.com/WordPress/performance/pull/1708))
 * Preload image URLs for LCP elements with external background images. ([1697](https://github.com/WordPress/performance/pull/1697))
 * Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643))

#### 0.2.0

**Enhancements**

 * Lazy load videos and video posters. ([1596](https://github.com/WordPress/performance/pull/1596))
 * Prioritize loading poster image of video LCP elements. ([1498](https://github.com/WordPress/performance/pull/1498))
 * Choose smaller video poster image size based on actual dimensions. ([1595](https://github.com/WordPress/performance/pull/1595))
 * Add fetchpriority=low to occluded initial-viewport images (e.g. images in hidden
   carousel slides). ([1482](https://github.com/WordPress/performance/pull/1482))
 * Avoid lazy-loading images and embeds unless there are URL Metrics for both mobile
   and desktop. ([1604](https://github.com/WordPress/performance/pull/1604))

#### 0.1.4

**Enhancements**

 * Move Auto Sizes logic from Enhanced Responsive Images to Image Prioritizer. (
   [1476](https://github.com/WordPress/performance/pull/1476))

#### 0.1.3

**Bug Fixes**

 * Fix handling of image prioritization when only some viewport groups are populated.(
   [1404](https://github.com/WordPress/performance/pull/1404))

#### 0.1.2

 * Cập nhật logic PHP để giải thích cho các thay đổi trong API Optimization Detective.(
   [1302](https://github.com/WordPress/performance/pull/1302))

#### 0.1.1

 * Khắc phục xử lý phân tích kiểu mà không có background-image của khách truy cập
   thẻ được tạo kiểu background-image. ([1288](https://github.com/WordPress/performance/pull/1288))

#### 0.1.0

 * Phát hành lần đầu.

## Plugin cộng đồng

Plugin này được phát triển và hỗ trợ bởi một cộng đồng. [Đóng góp cho plugin này](https://github.com/WordPress/performance)

## Meta

 *  Phiên bản **1.0.0-beta4**
 *  Cập nhật lần cuối **2 tháng trước**
 *  Số lượt cài đặt **40.000+**
 *  Phiên bản WordPress ** 6.9 hoặc cao hơn **
 *  Đã kiểm tra lên đến **7.1.3**
 *  Phiên bản PHP ** 7.4 hoặc cao hơn **
 *  Ngôn ngữ
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/image-prioritizer/), [English (UK)](https://en-gb.wordpress.org/plugins/image-prioritizer/),
   [English (US)](https://wordpress.org/plugins/image-prioritizer/), [French (France)](https://fr.wordpress.org/plugins/image-prioritizer/),
   [Persian](https://fa.wordpress.org/plugins/image-prioritizer/), [Portuguese (Brazil)](https://br.wordpress.org/plugins/image-prioritizer/),
   [Portuguese (Portugal)](https://pt.wordpress.org/plugins/image-prioritizer/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/image-prioritizer/), [Spanish (Spain)](https://es.wordpress.org/plugins/image-prioritizer/),
   [Swedish](https://sv.wordpress.org/plugins/image-prioritizer/), [Turkish](https://tr.wordpress.org/plugins/image-prioritizer/),
   và [Vietnamese](https://vi.wordpress.org/plugins/image-prioritizer/).
 *  [Dịch sang ngôn ngữ của bạn](https://translate.wordpress.org/projects/wp-plugins/image-prioritizer)
 * Thẻ
 * [image](https://vi.wordpress.org/plugins/tags/image/)[optimization](https://vi.wordpress.org/plugins/tags/optimization/)
   [optimization-detective](https://vi.wordpress.org/plugins/tags/optimization-detective/)
   [performance](https://vi.wordpress.org/plugins/tags/performance/)
 *  [Nâng cao](https://vi.wordpress.org/plugins/image-prioritizer/advanced/)

## Đánh giá

 5 trên 5 sao.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/image-prioritizer/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/image-prioritizer/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/image-prioritizer/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/image-prioritizer/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/image-prioritizer/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/image-prioritizer/reviews/#new-post)

[Xem tất cả đánh giá](https://wordpress.org/support/plugin/image-prioritizer/reviews/)

## Những người đóng góp

 *   [ WordPress Performance Team ](https://profiles.wordpress.org/performanceteam/)
 *   [ WordPress.org ](https://profiles.wordpress.org/wordpressdotorg/)

## Hỗ trợ

Các lỗi đã xử lý trong vòng hai tháng gần đây:

     1 trên 1

 [Xem diễn đàn hỗ trợ](https://wordpress.org/support/plugin/image-prioritizer/)