Title: Manually trigger webp filter
Last modified: November 23, 2022

---

# Manually trigger webp filter

 *  [Jonas Hjalmarsson](https://wordpress.org/support/users/jonashjalmarsson/)
 * (@jonashjalmarsson)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/manually-trigger-webp-filter/)
 * Thanks for a great plugin!
 * I use some ajaxified features on my page for popups and some other stuff. The
   wp_get_attachment_image_url return the original image url in those places. Is
   there a way for me to manually fetch that webp in my code from attachment id 
   or image url?

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

 *  [robaczek1](https://wordpress.org/support/users/robaczek1/)
 * (@robaczek1)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/manually-trigger-webp-filter/#post-16231384)
 * try adding .webp to the called file name, this should trigger the converter and
   in result generate a webp file if it doesn’t exist after which it will be displayed
   to your visitors. Also make sure to use option “append .webp” instead of rename,
   so that your images will look like this: image.jpg.webp – then this will work.
    -  This reply was modified 3 years, 6 months ago by [robaczek1](https://wordpress.org/support/users/robaczek1/).
 *  Thread Starter [Jonas Hjalmarsson](https://wordpress.org/support/users/jonashjalmarsson/)
 * (@jonashjalmarsson)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/manually-trigger-webp-filter/#post-16235030)
 * I’m using CDN friendly setup with alter html setting activated. So your suggestion
   didn’t work for me. There are no way to hook or filter in an other way when I
   fetch my image?
 *  [robaczek1](https://wordpress.org/support/users/robaczek1/)
 * (@robaczek1)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/manually-trigger-webp-filter/#post-16235750)
 * You said wp_get_attachment_image_url return the original image url in those places,
   so you need a piece of jacascript coding that will grab this original image url
   and change it by adding .webp at the end that will in turn fire up the converter
   or simply display a webp version if it already exists. That’s how my programmer
   did this on my website and it works.

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

The topic ‘Manually trigger webp filter’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [robaczek1](https://wordpress.org/support/users/robaczek1/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/manually-trigger-webp-filter/#post-16235750)
 * Status: not resolved