Support » Plugin: EWWW Image Optimizer » Limit bulk optimization to certain files via regex

  • Resolved davydov-denis

    (@davydov-denis)


    Dear developers,

    I would like to run bulk optimization, but limit it to files that are generated by a theme (as a part of adaptive images) as opposed to the originals I upload to the Media Gallery. Is there any way to control which files will be optimized?
    It would be good to have an option to specify a regex, i.e. *abc*.jpg or so.

Viewing 1 replies (of 1 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    There are a few options to limit the scope of optimization.
    1. From the media library, switch to list mode, and you can optimize individual images there.
    2. You can also select multiple images from there and use the bulk actions to optimize several images at once.
    3. On the advanced EWWW IO tab, you can specify Folders to Include or Folders to Ignore. Note that Folders to Include is not exclusive. If you add a folder and then run the bulk optimizer, it will do everything in Folders to Include, plus all the media library images.
    4. If you have any development ability, you can use the ewww_image_optimizer_bypass filter. It’s located near the top of the core ewww_image_optimizer() function in the unique.php file.
    Basically, it passes two parameters, the first will be boolean false, the second is the filename. That way you can check the filename, and skip it if it doesn’t match your pattern by returning boolean true.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.