tr Skip to content
Black Friday FlowMattic for life, 12 payments of $33.25 Or $399 once. Nothing added for splitting Ends in --Days --Hrs --Min --Sec See the deal

Compress Images Automatically With a Workflow Step in WordPress

FlowMattic Image Compressor module: an image uploaded through a form is compressed, optionally converted and resized, and saved to the Media Library.

Large images slow pages down, bloat emails and fill your storage. FlowMattic’s Image Compressor module lets you compress images automatically as a workflow step: give it an image URL, choose a quality and an output format, optionally cap the dimensions, and the smaller copy is saved to your Media Library with a URL the next step can use.

It fits wherever images enter your site through a process rather than by hand: form uploads, product imports, generated graphics or files fetched from another app.

What is the Image Compressor?

Image Compressor is a built-in action app in the FlowMattic workflow builder: “Compress images and store them in WordPress media library.” Its one action, Compress Image, compresses an image and saves it to the Media Library. You will find it with the other data tools.

Here is what happens on each run. Your server downloads the image from the URL, sends it to FlowMattic’s compression service, and saves the compressed result as a new Media Library item. The original image is left as it was. The step needs an active FlowMattic license.

How to compress images automatically

  1. Add a step after your trigger and choose Image Compressor, action Compress Image.
  2. In Image URL, map the image, for example the file URL from a form upload.
  3. Set Quality from 1 to 100. The default is 80.
  4. Pick an Output Format: Auto, JPEG, PNG or WebP.
  5. Set Enable Resize to Yes if you want to cap the size, then fill in Max Width (px) and Max Height (px).
  6. Test the step and map media_url into the next step.
FlowMattic workflow builder showing the Image Compressor step with Image URL, Quality, Output Format, Enable Resize, Max Width (px) and Max Height (px) fields.
The Compress Image action with quality 80, WebP output and resize capped at 1920 by 1080 pixels.

Options and output

OptionWhat it does
Image URLThe image to compress. Required.
Quality1 to 100, default 80. Higher keeps more detail and produces a larger file.
Output FormatAuto keeps the original format. JPEG, PNG and WebP convert the image.
Enable ResizeYes or No. Yes shows the two size fields below.
Max Width (px)Maximum width when resizing, default 1920.
Max Height (px)Maximum height when resizing, default 1080.

A successful run returns media_id, media_url, media_title, media_type, the original_url, the compression_quality and format used, and, when WordPress records them, width, height and file_size.

Use cases

Shrink photos customers upload through a form

Phone photos are often several megabytes. Compress each upload to WebP with a 1920 by 1080 cap before it is attached to the support ticket or the gallery entry.

Form submission → Image Compressor → Helpdesk: add attachment

Lighter product images on import

A supplier feed sends full-size product photos. Compress each one before it is set as the product image so category pages load faster.

Scheduler → API request (supplier feed) → Iterator → Image Compressor → WooCommerce: update product

Email-friendly images for newsletters

Featured images make heavy email headers. Compress the post’s featured image to JPEG at a lower quality and use the smaller URL in the newsletter.

WordPress: new post → Image Compressor → Email campaign

Compress generated social cards

The Image Template Builder creates a social card for each new post. Compress it before posting so uploads are quick and within size limits.

WordPress: new post → Image Template → Image Compressor → Social post

Smaller files for client handover

Agencies delivering photo sets can compress each image and then bundle the results with the ZIP Archive module for one tidy download.

Webhook (image list) → Iterator → Image Compressor → ZIP Archive (Create) → Email

Convert screenshots to WebP for a knowledge base

Support teams can convert PNG screenshots to WebP before they go into help articles, keeping pages quick without editing each file.

Form submission (screenshot) → Image Compressor (WebP) → WordPress: create post

Tips and gotchas

  • Watch for loops with the New Media trigger. The compressed copy is a new Media Library item. If the same workflow starts on WordPress New Media, it will fire again for its own output unless a Filter stops it.
  • Set Enable Resize on purpose. With No, no size limits are sent and the Max Width and Max Height values are ignored. The step treats an unset choice as No, so pick Yes explicitly when dimensions matter.
  • The original stays. The step adds a compressed copy and never replaces the source. Delete the original in a later step if you don’t need it.
  • The image passes through FlowMattic’s service. Compression runs on FlowMattic’s compression API, so the image leaves your server for that step. Keep this in mind for sensitive images.
  • License required. Without an active license, the step returns an error asking you to activate or renew.
  • Time limits. The download is allowed up to 300 seconds and the compression call up to 60 seconds, so very large files can time out.

Related features

FAQ

How do I compress images automatically in WordPress?

Create a FlowMattic workflow with the trigger that brings the image in, add the Image Compressor step, and map the image URL. Every run saves a compressed copy to the Media Library and returns its URL.

Can it convert images to WebP?

Yes. Set Output Format to WebP. You can also convert to JPEG or PNG, or choose Auto to keep the original format.

Does it replace the original image?

No. The compressed image is saved as a new Media Library item, and the original stays untouched. Use the returned media_url wherever you want the smaller version.

What quality setting should I use?

Start with the default of 80 and check the result. Lower values give smaller files with more visible loss; higher values keep more detail at a larger size.

The Image Compressor is one of many built-in modules that sit alongside nearly 900 integrations in FlowMattic. See the plans and compress images automatically wherever they enter your site.

More from the blog