Title: How to replace a picture with webp in php code programmatically?
Last modified: May 5, 2020

---

# How to replace a picture with webp in php code programmatically?

 *  [alexlancer](https://wordpress.org/support/users/alexlancer/)
 * (@alexlancer)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/how-to-replace-a-picture-with-webp-in-php-code-programmatically/)
 * I load part of the page content through AJAX.
    How to replace a picture with 
   webp in php code programmatically like this:
 * $src = ‘image.jpg’;
    $src_webp = get_webp_image( $src );
    -  This topic was modified 6 years, 1 month ago by [alexlancer](https://wordpress.org/support/users/alexlancer/).

Viewing 1 replies (of 1 total)

 *  [Managedserver.it](https://wordpress.org/support/users/dreamsnet/)
 * (@dreamsnet)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/how-to-replace-a-picture-with-webp-in-php-code-programmatically/#post-12785978)
 * Use varied image response and server settings. Not code.

Viewing 1 replies (of 1 total)

The topic ‘How to replace a picture with webp in php code programmatically?’ is 
closed to new replies.

 * ![](https://ps.w.org/webp-express/assets/icon.svg?rev=1918288)
 * [WebP Express](https://wordpress.org/plugins/webp-express/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-express/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-express/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-express/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-express/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-express/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Managedserver.it](https://wordpress.org/support/users/dreamsnet/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/how-to-replace-a-picture-with-webp-in-php-code-programmatically/#post-12785978)
 * Status: not resolved