{"id":29896,"date":"2021-10-16T00:03:18","date_gmt":"2021-10-16T00:03:18","guid":{"rendered":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/"},"modified":"2026-05-02T04:40:04","modified_gmt":"2026-05-02T04:40:04","slug":"image-compression","status":"publish","type":"knowledgebase","link":"https:\/\/www.wpstaq.com\/sg\/knowledgebase\/image-compression\/","title":{"rendered":"Image Optimization, Compression and WebP"},"content":{"rendered":"<p>The Staq infrastructure can optimize (compress size and convert to WebP) your WordPress media library images directly on the server \u2014 no third-party plugins or external services required. This reduces file sizes, improves page load speed, and optionally generates WebP versions of your images.<\/p>\n<p><strong>Note:<\/strong> Media Optimisation is <strong>disabled by default<\/strong>. You must enable it once per website inside WordPress.<\/p>\n<h2>How It Works<\/h2>\n<p>Once enabled, optimisation runs automatically in the background. Before any compression takes place, your original images are safely backed up to S3, allowing you to restore them at any time.<\/p>\n<p>Staq uses proven server-side tools:<\/p>\n<ul>\n<li><strong>JPEG\/JPG:<\/strong> Recompressed using <code>jpegoptim<\/code><\/li>\n<li><strong>PNG:<\/strong> Optimised using <code>pngquant<\/code> + <code>optipng<\/code><\/li>\n<li><strong>WebP:<\/strong> Generated using <code>cwebp<\/code> as a sidecar file (original files remain untouched)<\/li>\n<\/ul>\n<h2>How to Enable Media (JPEG &amp; PNG) Optimisation<\/h2>\n<ol>\n<li>Log into the WordPress site.<\/li>\n<li>Click <strong>Staq Hosting<\/strong>.<\/li>\n<li>Open the <strong>Media<\/strong> tab.<\/li>\n<li>Enable <strong>Media optimisation<\/strong>.<\/li>\n<li>Adjust settings if required (defaults are recommended).<\/li>\n<li>Click <strong>Save Settings<\/strong>.<\/li>\n<\/ol>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89230 size-large\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization-1024x652.png\" alt=\"\" width=\"1024\" height=\"652\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization-1024x652.png 1024w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization-300x191.png 300w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization-768x489.png 768w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization-1536x978.png 1536w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-image-compression-optimization.png 1799w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/strong><\/p>\n<p>Once saved, Staq will automatically queue a background job to process JPEG and PNG images in your media library.<\/p>\n<h2>Enabling WebP Conversion<\/h2>\n<p>WebP creates smaller versions of your images without replacing the originals.<\/p>\n<ol>\n<li>Go to <strong>Staq Hosting \u2192 Media<\/strong>.<\/li>\n<li>Enable <strong>WebP Conversion:<\/strong><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-89231\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images-1024x652.png\" alt=\"\" width=\"1024\" height=\"652\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images-1024x652.png 1024w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images-300x191.png 300w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images-768x489.png 768w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images-1536x978.png 1536w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/enable-webp-images.png 1799w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Then ensure WebP delivery is enabled:<\/p>\n<ol>\n<li>Go to <strong>Optimizer \u2192 Media<\/strong>.<\/li>\n<li>Enable <strong>Serve next-gen images (WebP)<\/strong>.<\/li>\n<\/ol>\n<p>When enabled, cached pages will automatically serve WebP images where supported.<\/p>\n<p><strong>Note:<\/strong> WebP replacement does not apply to images inside CSS files.<\/p>\n<h2>What Gets Optimised<\/h2>\n<ul>\n<li><strong>JPEG\/JPG:<\/strong> Compressed + optional WebP<\/li>\n<li><strong>PNG:<\/strong> Compressed + optional WebP<\/li>\n<li><strong>WebP:<\/strong> Not reprocessed<\/li>\n<li><strong>SVG:<\/strong> Not processed<\/li>\n<li><strong>GIF:<\/strong> Not processed<\/li>\n<li><strong>Videos:<\/strong> Not supported<\/li>\n<\/ul>\n<p><strong>Minimum thresholds:<\/strong><\/p>\n<ul>\n<li>Under 10KB \u2192 compression skipped<\/li>\n<li>Under 4KB \u2192 WebP skipped<\/li>\n<\/ul>\n<h2>How Optimisation Is Triggered<\/h2>\n<ul>\n<li><strong>On Upload:<\/strong> Images are queued immediately<\/li>\n<li><strong>Daily Scan:<\/strong> Detects unoptimised images via nginx logs<\/li>\n<li><strong>On Save:<\/strong> Saving settings triggers a full scan<\/li>\n<\/ul>\n<p>No manual action is required.<\/p>\n<h2>Reverting to Original Images<\/h2>\n<ol>\n<li>Go to <strong>Media \u2192 Overview<\/strong><\/li>\n<li>Click <strong>Revert to Originals<\/strong><\/li>\n<\/ol>\n<p>This restores images from S3 and removes generated WebP files.<\/p>\n<h2>Statistics<\/h2>\n<h3>Overview Statistics<\/h3>\n<p>To view total compression savings:<\/p>\n<ul>\n<li>Go to <strong>Staq Hosting \u2192 Media \u2192 Overview<\/strong><\/li>\n<li>View total size reduction and performance gains<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-89232\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview-1024x574.png\" alt=\"\" width=\"1024\" height=\"574\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview-1024x574.png 1024w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview-300x168.png 300w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview-768x430.png 768w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview-1536x861.png 1536w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/image-optimization-overview.png 1672w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3>Specific Image Statistics<\/h3>\n<p>To view details for a specific image:<\/p>\n<ul>\n<li>Go to <strong>Media Library<\/strong><\/li>\n<li>Select an image<\/li>\n<li>Click <strong>More Details<\/strong> under the optimisation label<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-89233\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/specific-image-stats.png\" alt=\"\" width=\"737\" height=\"428\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/specific-image-stats.png 737w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/specific-image-stats-300x174.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h2>Viewing WebP Images<\/h2>\n<p>To confirm WebP is generated:<\/p>\n<ul>\n<li>Open the image in the <strong>Media Library<\/strong><\/li>\n<li>Look for the <strong>Optimisation<\/strong> label<\/li>\n<li>If WebP is enabled, you will see:\n<ul>\n<li>WebP file size<\/li>\n<li>Compression savings<\/li>\n<li>Option to copy the WebP URL<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-89234\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/webp-stats.png\" alt=\"\" width=\"763\" height=\"491\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/webp-stats.png 763w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2021\/10\/webp-stats-300x193.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n","protected":false},"featured_media":29620,"parent":0,"template":"","class_list":["post-29896","knowledgebase","type-knowledgebase","status-publish","has-post-thumbnail","hentry","categories-media-optimize"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress\" \/>\n<meta property=\"og:description\" content=\"The Staq infrastructure can optimize (compress size and convert to WebP) your WordPress media library images directly on the server \u2014 no third-party plugins or external services required. This reduces file sizes, improves page load speed, and optionally generates WebP versions of your images. Note: Media Optimisation is disabled by default. You must enable it&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/\" \/>\n<meta property=\"og:site_name\" content=\"Managed Hosting Platform for WordPress\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/staqhosting\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-02T04:40:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/image-compression-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/\",\"name\":\"Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-compression-1.png\",\"datePublished\":\"2021-10-16T00:03:18+00:00\",\"dateModified\":\"2026-05-02T04:40:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/#breadcrumb\"},\"inLanguage\":\"en-sg\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-sg\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-compression-1.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-compression-1.png\",\"width\":1000,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/image-compression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.wpstaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Image Optimization, Compression and WebP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"name\":\"Managed Hosting Platform for WordPress\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wpstaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-sg\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\",\"name\":\"Staq\",\"alternateName\":\"WPStaq\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-sg\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"width\":512,\"height\":512,\"caption\":\"Staq\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/staqhosting\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpstaq\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/","og_locale":"en_US","og_type":"article","og_title":"Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress","og_description":"The Staq infrastructure can optimize (compress size and convert to WebP) your WordPress media library images directly on the server \u2014 no third-party plugins or external services required. This reduces file sizes, improves page load speed, and optionally generates WebP versions of your images. Note: Media Optimisation is disabled by default. You must enable it&hellip;","og_url":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/","og_site_name":"Managed Hosting Platform for WordPress","article_publisher":"https:\/\/www.facebook.com\/staqhosting\/","article_modified_time":"2026-05-02T04:40:04+00:00","og_image":[{"width":1000,"height":500,"url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/image-compression-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/","url":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/","name":"Image Optimization, Compression and WebP - Managed Hosting Platform for WordPress","isPartOf":{"@id":"https:\/\/www.wpstaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/#primaryimage"},"image":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/image-compression-1.png","datePublished":"2021-10-16T00:03:18+00:00","dateModified":"2026-05-02T04:40:04+00:00","breadcrumb":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/#breadcrumb"},"inLanguage":"en-sg","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/"]}]},{"@type":"ImageObject","inLanguage":"en-sg","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/#primaryimage","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/image-compression-1.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/image-compression-1.png","width":1000,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/image-compression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wpstaq.com\/"},{"@type":"ListItem","position":2,"name":"Image Optimization, Compression and WebP"}]},{"@type":"WebSite","@id":"https:\/\/www.wpstaq.com\/#website","url":"https:\/\/www.wpstaq.com\/","name":"Managed Hosting Platform for WordPress","description":"","publisher":{"@id":"https:\/\/www.wpstaq.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wpstaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-sg"},{"@type":"Organization","@id":"https:\/\/www.wpstaq.com\/#organization","name":"Staq","alternateName":"WPStaq","url":"https:\/\/www.wpstaq.com\/","logo":{"@type":"ImageObject","inLanguage":"en-sg","@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","width":512,"height":512,"caption":"Staq"},"image":{"@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/staqhosting\/","https:\/\/www.linkedin.com\/company\/wpstaq"]}]}},"_links":{"self":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/knowledgebase\/29896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/types\/knowledgebase"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/media\/29620"}],"wp:attachment":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/media?parent=29896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}