Title: img decoding=&#8221;async&#8221;
Last modified: November 8, 2023

---

# img decoding=”async”

 *  Resolved [bcolflesh](https://wordpress.org/support/users/bcolflesh/)
 * (@bcolflesh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/img-decodingasync/)
 * WordPress 6.4 is suddenly injecting (decoding=”async”) to img tags inside my 
   custom plugins, breaking the JavaScript, since they don’t properly escape the
   quotes.
   How do I turn this off?Addin (decoding=”async”) myself to the plugin 
   doesn’t get detected and it is just injected again unescaped.

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

 *  Thread Starter [bcolflesh](https://wordpress.org/support/users/bcolflesh/)
 * (@bcolflesh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/img-decodingasync/#post-17182842)
 * I refactored that section of my plugin quick to use single instead of double 
   quotes on the JavaScript injected img tag, but man, it doesn’t seem smart at 
   all to do this – what are people with plugins they didn’t make and no expertise/
   support going to do when this breaks their site?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/img-decodingasync/#post-17189630)
 * The attribute is added by [wp_img_tag_add_loading_optimization_attrs()](https://developer.wordpress.org/reference/functions/wp_img_tag_add_loading_optimization_attrs/).
   The decoding attribute behavior can be modified through the ‘wp_img_tag_add_decoding_attr’
   filter. Review the source code of the above linked function to see the inline
   doc for this filter, starting at line 1978.
 * Because this is happening server side, what you do client side like adding your
   own attribute will not change what happens server side.
 * I’m not sure what you’re expecting to be escaped, attribute values are escaped,
   not the surrounding HTML. If HTML were escaped it’d be interpreted as plain text
   instead of HTML.
 * For better or worse, plugin devs are expected to keep abreast of new developments
   in WP core. 6.4 release candidate has been available for testing for some time
   now. Efforts are made to maintain reverse compatibility, but it’s simply not 
   always possible.
 *  Thread Starter [bcolflesh](https://wordpress.org/support/users/bcolflesh/)
 * (@bcolflesh)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/img-decodingasync/#post-17189648)
 * Thanks for the explanation – I see the latest 6.4 update has not gone well on
   various forums for other reasons and I’m sure this is a small issue/workaround
   in comparison.

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

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [bcolflesh](https://wordpress.org/support/users/bcolflesh/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/img-decodingasync/#post-17189648)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
