Title: decoding=&#8221;async&#8221;
Last modified: January 25, 2025

---

# decoding=”async”

 *  Resolved [Guillermo](https://wordpress.org/support/users/guillermo77/)
 * (@guillermo77)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/)
 * Just like Know if the plugin remove decoding=”async”
 * I have one function for remove all decoding=”async”
 *     ```wp-block-code
       // Remove decoding=asyncadd_filter('wp_img_tag_add_decoding_attr', '__return_false');
       ```
   

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271028)
 * Do you mean whether the plugin _adds_ `decoding="async"`? No, it does not currently
   do this because WordPress adds it to all images already.
    -  This reply was modified 1 year, 3 months ago by [Weston Ruter](https://wordpress.org/support/users/westonruter/).
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271030)
 * Question: Why are you removing this?
 *  Thread Starter [Guillermo](https://wordpress.org/support/users/guillermo77/)
 * (@guillermo77)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271069)
 * I thnk give me high LCP in desktop. 4.0, now is 2.4
 * [https://gist.github.com/vyskoczilova/d5a66d3578c01ea639c74696dcf9a636](https://gist.github.com/vyskoczilova/d5a66d3578c01ea639c74696dcf9a636)
 * [https://kybernaut.cz/en/clanky/the-unintended-consequences-of-decodingasync-on-your-wordpress-sites-lcp/](https://kybernaut.cz/en/clanky/the-unintended-consequences-of-decodingasync-on-your-wordpress-sites-lcp/)
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271098)
 * Interesting. I’ll have to look into that further. If this is the case, then core
   should be adding `decoding=sync` for any image that is not lazy-loaded. However,
   I’m 99% sure this has already been analyzed to see if there is a negative impact
   on LCP when `decoding=async` is present.
 *  Thread Starter [Guillermo](https://wordpress.org/support/users/guillermo77/)
 * (@guillermo77)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271112)
 * wordpress use decoding async also wth fetchpriority high, that no is good, was
   one surprise watch that!
 * In mobile LCP is good, just the PC was the problem, where images are in the viewport
 * I remove also the littlespeed cache plugin, but I am sure the problem was the
   decoding async!
 * I think also can add fetchpriority high to the second image, with that, you cover
   the viewport for sure in the majority of posts. Simple solution. If have one 
   logo can be 3 images.
 * Thanks for your answer!
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18271327)
 * I did some benchmarking with the Twenty Twenty-One theme with a desktop viewport(
   1350×940) on a post singular view there is an Image block at the beginning of
   the content with “Full width” alignment so the largest image size will be used.
   I used LocalWP for my test environment. By default, WordPress renders this on
   the frontend as:
 *     ```wp-block-code
       <img fetchpriority="high" decoding="async" width="1024" height="668" src="http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-1024x668.jpg" alt="" class="wp-image-7" srcset="http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-1024x668.jpg 1024w, http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-300x196.jpg 300w, http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-768x501.jpg 768w, http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-1536x1002.jpg 1536w, http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-2048x1336.jpg 2048w, http://localhost:10048/wp-content/uploads/2025/01/American_bison_k5680-1-1568x1023.jpg 1568w" sizes="(max-width: 1024px) 100vw, 1024px">
       ```
   
 * Note the `fetchpriority=high` here which is correct since it is the LCP element.
   I also added a plugin to this site to allow manipulation of `decoding=async` 
   via a query parameter:
 *     ```wp-block-code
       if ( isset( $_GET['add_decoding_attr'] ) ) {	add_filter(		'wp_img_tag_add_decoding_attr',		static function () {			return rest_sanitize_boolean( $_GET['add_decoding_attr'] );		}	);}
       ```
   
 * Then I used the [benchmark-web-vitals](https://github.com/GoogleChromeLabs/wpp-research/tree/main/cli#benchmark-web-vitals)
   command to make 250 requests to the URL with `decoding=async` removed and 250
   requests with it added.
 * With a file `decoding-async-urls.txt`:
 *     ```wp-block-code
       http://localhost:10048/lcp-image/?add_decoding_attr=falsehttp://localhost:10048/lcp-image/?add_decoding_attr=true
       ```
   
 * I ran this command:
 *     ```wp-block-code
       npm run research -- benchmark-web-vitals --number=250 --file=decoding-async-urls.txt --output=csv --window-viewport=desktop --show-variance --show-percentiles
       ```
   
 * See the results in this [Google Sheet](https://docs.google.com/spreadsheets/d/1VzWsFCDbkdAggZ_DK4p1VldbihkcgZYT7IIIMO7xwss/edit?gid=433241203#gid=433241203).
   You can see from the results that the median LCP-TTFB metric (highlighted in 
   bold) shows that adding `decoding=async` actually _improves_ (reduces) LCP by
   6.7%. Without the attribute the metric was 72.95 ms, when the attribute was added
   the LCP decreased to 68.05 ms.
 * See also the original [investigation](https://core.trac.wordpress.org/ticket/53232#comment:34)
   by [@mihai2u](https://wordpress.org/support/users/mihai2u/) on the Trac ticket
   for adding `decoding=async` by default where he found no negative impact when
   this attribute is added to the LCP `IMG` element. (Hey!)
 * I would love like to see metrics from [@vyskoczilova](https://wordpress.org/support/users/vyskoczilova/)
   for [her post](https://kybernaut.cz/en/clanky/the-unintended-consequences-of-decodingasync-on-your-wordpress-sites-lcp/)
   on how she determined that adding `decoding=async` negatively impacts LCP. (Hi!)
 * If there is conclusive evidence that adding `decoding=async` hurts LCP performance,
   then core definitely should not be adding this to the `IMG` it adds `fetchpriority
   =high` to (in the same way it omits `loading=lazy`). However, we haven’t seen
   this to be the case.
 * I’m also just now seeing that Karolina opened a Trac ticket about this: [https://core.trac.wordpress.org/ticket/58631](https://core.trac.wordpress.org/ticket/58631).
   I’ll follow up there.
 *  Thread Starter [Guillermo](https://wordpress.org/support/users/guillermo77/)
 * (@guillermo77)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18273062)
 * I am a simple user of WordPress, and you are a Genius
 * But, but but,
 * Fetchpriority is one recommendation, and async is one order, if i read well. 
   No is correct use the two.
 * I try use disable async just in fetchpriority, but no work, so I disable all 
   with the script.
 * One post example can be,, google adsense, header, parraph, image, image, parraph,
   parraph, image, youtube embed (i dont remember if also have async), parraph, 
   related post, adsense, maybe some javascript in the foot.
 * And one old pc with old wifi, etc, one web from asia or europe, maybe you can
   have one slow LCP.
 * For example, in pagespeed tests, i get 0.5 – 0.9 LCP (I am in latinamerica) but
   in statistics the group page are 2.4, with visits of my country.
 * No is easy, experience is different than any test, but you know more than me.
 * One time my web run ok, maybe i add again the async for test and back to you
 * Thank you for your answer and your time 👍👋
 *  [Mike Crantea](https://wordpress.org/support/users/mihai2u/)
 * (@mihai2u)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18274846)
 * Thank you for the mention, and referring the investigation from 3 years ago [@westonruter](https://wordpress.org/support/users/westonruter/).
   Even now, I’m yet to experience the negative consequence from using decoding=”
   async” on all images (including the one awarded the LCP), including when testing
   with significant CPU throttling (20x).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘decoding=”async”’ is closed to new replies.

 * ![](https://ps.w.org/image-prioritizer/assets/icon.svg?rev=3099535)
 * [Image Prioritizer](https://wordpress.org/plugins/image-prioritizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/image-prioritizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/image-prioritizer/)
 * [Active Topics](https://wordpress.org/support/plugin/image-prioritizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/image-prioritizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/image-prioritizer/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [Mike Crantea](https://wordpress.org/support/users/mihai2u/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/decodingasync-2/#post-18274846)
 * Status: resolved