We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Is WebP supported?

  • #3583
    Avatar photo[anonymous]

    I’m trying out a new image format, WebP.
    I D&D’d the thing into Publii’s editor to try it out and found it to be pasted and previewable.
    But when I tried to use WebP for the image gallery, I couldn’t see it in the folder view in the modal window where you select the image to use, because the image extension is limited to “jpg, jpeg, png”.

    Also, I am using “Simple” as a theme and when I set a WebP image as a Hero section image, it did not appear.
    The Logo is also visible in WebP.
    This may be more of a theme issue than a problem with Publii’s editor.

    My feeling is that the former problem could be solved by eliminating the limitation of the image reference modal window extension.
    (Or this could be a more complex Issue.
    The latter problem, the non-visible Hero section WebP, foreshadows this.)

    Is it possible to support WebP?

    Avatar photoBob
    Avatar photo[anonymous]

    I’ve never heard of either????
    I’ve tried a lot of things, but I think WebP is indeed still slightly premature.
    I’m looking forward to it! Thank you.

    Avatar photo[anonymous]

    Webp is really a must for SEO… Google made it so google likes to see it. In our agency we have greatly improved our seo scores with the implementation of webp. Note that we already had implemented various formats (with picture tag) which already improved our scores but webp is a must nowadays.

    But I can clearly understand that compression can take a lot of time and adding this new format could be an issue. So it should be optional (and maybe even under an advanced menu). If you don’t want it, don’t use it by default but if you want to increase your seo score, use it definitely !

    Avatar photoBob
    [anonymous] wrote:

    Webp is really a must for SEO

    Nothing stands in the way of using this format right now, just upload the picture in the Webp format and it should work.

    Btw, how do you think it should be done, implemented in Publii? Should the app convert all input formats to one common WebP output?
    Using picture syntax will generate multiple images in different formats which we would like to avoid.

    Avatar photo[anonymous]

    Indeed the best way to implement correctly web is by using the picture syntax because some navigators don’t support webp. Just replacing jpg or png with webp in an image tag won’t work on some browsers and that’s not a good idea.

    A friend of mine did use javascript to detect if webp was supported by the navigator or not. By default webp images were displayed, if not, he would use a data attribute with the jpeg or png file and replace the src by the content of this data field in javascript. It’s kinda complicated but still works and avoid the use of picture tag. Something like this :

    My picture
    //some test to see if webp is unsupported
        if(notsupported) {
            $("img").each(function () {
                var filename=$(this).data("file");

    The issue is that you need to have js enabled to see the image. You have to display webp before another format to be seo (especially google bot) friendly…

    Picture tag is still the best solution allowing to manage different resolutions but still needs to generate multiple pictures.

    If your priority is not to generated too many pictures, then you should avoid webp. Once again this takes some time to generate so it has to be optional.

    Avatar photoBob

    yeap, I agree entirely with you.

    It’s probably a good idea to create an optional plugin for Publii.