Back to Guides

Vyso Guides

Optimize WordPress images without a plugin

Updated October 12, 2026
WordPressImage optimizationManual workflow

You can optimize WordPress images without a plugin by resizing and compressing files before upload, choosing appropriate image sizes in the editor, and using WordPress's generated variants. For a small publishing workflow, this can be enough. Older libraries and automatic reprocessing require more manual work or a developer-managed process.

Start with a separate web export from your original image. Keep the master, prepare a delivery copy, upload it, and verify the public page. Treat dimensions, encoded file size, and page loading behavior as separate checks.

Prepare a web copy before uploading

Measure the largest display width the image needs. If a content column is 800 CSS pixels wide, a 1600-pixel export is a candidate to evaluate for a 2× display. These numbers illustrate that layout; use your own page measurements. Product zoom and downloadable photographs can require higher-resolution copies.

Use a local editor or Squoosh to resize and compare compression settings. Squoosh processes images on your device. Check detail at the intended display size and zoom into text, fine patterns, and edges before exporting.

  1. Open a copy of the original and set the intended dimensions.

  2. Compare a suitable photographic format with WebP or AVIF when your upload and delivery setup supports them. Use a format that preserves transparency for graphics that need it.

  3. Adjust compression until you find the smallest version that passes your visual check.

  4. Export to a new file and record its dimensions and bytes. Use a descriptive filename before uploading.

Lossless compression preserves the decoded image's pixels. Lossy compression trades some information for smaller output, even if you cannot see a difference at the intended size. Start each new export from the master so repeated lossy saves do not accumulate damage. The compression guide explains that trade-off in more detail.

Use the image sizes WordPress already provides

Open Settings > Media and review the thumbnail, medium, and large dimensions. The WordPress Media settings tutorial explains how these generated sizes relate to the uploaded image. Your theme can add more sizes.

When inserting an image into a post, choose an available resolution that suits its placement. Review the selected file on the public page as well as its displayed size. A theme may add responsive candidates, and a page builder may use a different rendering path.

WordPress's native responsive markup uses srcset and sizes for image selection. If a custom template hard-codes an uploads URL, ask its developer to use the appropriate attachment function, such as wp_get_attachment_image(), and check the result. A hand-written image URL lacks attachment information that WordPress uses to build responsive markup.

CSS can keep an image inside its container, but CSS width alone does not establish which file the browser downloads. Inspect the selected resource before deciding that the smaller appearance solved the transfer problem.

Handle formats without installing a converter

You can upload a prepared WebP or AVIF file when the WordPress version and processing environment support it. The uploader must also be able to create the sizes your templates require. Format acceptance and thumbnail generation are both worth testing.

For server processing, check Tools > Site Health > Info > Media Handling and ask the host about GD or Imagick support. WordPress 7.1's client-side media processing adds a browser path in supporting editor environments, with server fallback. A successful upload through that path does not establish that a server-side import or thumbnail regeneration can encode the same format.

Uploading a WebP file also does not rewrite JPEG attachments already used in older posts. Work through those separately. A new file in the Media Library usually has a new attachment and URL, so existing placements need to be updated deliberately.

Fix existing images with a limited manual pass

Start with frequently visited pages and their largest image requests. Save the current attachment IDs, placement, and URLs. Prioritizing actual downloads is more useful than compressing files that no public page requests.

For an oversized individual image, WordPress provides scaling through Media Library > Edit Image. Its media editing instructions cover scaling and restoring an edited image. Check any other pages that use the same attachment after changing it.

For a newly exported replacement, upload it and update the image block or featured-image selection. If it appears in several posts, update each placement. Clear page caches that still contain the old URL. Preserve alt text and captions where they remain accurate.

Replacing upload files directly over SFTP can leave attachment metadata, dimensions, and generated variants inconsistent. Use a documented replacement or regeneration workflow when the old URL must stay. Back up upload files and database metadata before altering existing attachments.

Free command-line tools for repeatable exports

A developer can automate preparation outside WordPress with a command-line encoder. Install the WebP tools for your platform from the publisher's download instructions. You need shell access and permission to read the input and write the output directory. Confirm the executable is available:

cwebp -version

Google's cwebp documentation describes resizing and WebP encoding. This example takes a photograph named workshop-photo.jpg and writes a separate output:

cwebp -q 78 -resize 1600 0 workshop-photo.jpg -o workshop-photo-web.webp

The zero height asks the tool to retain the aspect ratio for a 1600-pixel width. Use this on an input that is larger than the intended export. The quality value 78 is a trial setting. Compare the result before adopting it for your photographs.

For a graphic that requires lossless encoding, use a separate trial:

cwebp -lossless -exact diagram.png -o diagram-web.webp

The -exact option preserves otherwise invisible RGB values in transparent pixels during lossless encoding. Compare output size and appearance before adopting either command in a batch script. Keep inputs and outputs in separate directories. A batch that repeatedly converts an earlier export is harder to audit than one that always reads the masters.

For GitHub-based workflows, use repositories maintained by the tool's publisher, such as GoogleChromeLabs/Squoosh. A repository gives you code and development information; it does not establish compatibility with your particular WordPress theme or host. Check current documentation before depending on an old CLI wrapper.

Regenerate sizes after changing the media configuration

WP-CLI can rebuild generated sizes without adding a dashboard plugin. You need it installed, shell access, a working server image editor, and permission to write uploads. Run these checks from the WordPress installation directory:

wp --info
wp core version

Regenerate one known attachment first. Here, 123 is an example ID; replace it with a test image's attachment ID:

wp media regenerate 123 --skip-delete

The WP-CLI media command documentation describes limiting regeneration to particular attachments or a registered size. Retaining old thumbnails can protect URLs still used elsewhere, but a regeneration may overwrite files with the same generated name. Keep a backup and inspect the result before a larger pass.

Changing generated dimensions does not guarantee additional compression of every main upload. Decide whether the batch is rebuilding derivatives, replacing source attachments, or re-encoding particular files before running it.

Check the public download and the maintenance cost

Open a public page while logged out and identify the selected image URL through currentSrc. In the Network panel, disable browser caching before reloading and compare response type, bytes, and pixel dimensions under the same conditions. This does not purge a server or CDN cache. Compare mobile and desktop placements, including any lightbox or zoom view.

Plugin-free optimization works well when editors can follow an export procedure and upload volume is modest. It becomes more labor-intensive with imports, many contributors, or a large historical library. The software may be free while preparation, replacement, and quality checks still take time.

Keep a short export note beside the source images: intended placement, maximum width, output format, and the last visual check. Before changing the policy, re-export a small set from the masters and compare the public requests. That record makes a manual workflow repeatable without turning every upload into a new experiment.

Use external delivery from a custom template

If images are already stored in Vyso, a custom WordPress template can use its CDN delivery URLs to request resized images with chosen quality and output formats while retaining the original. Build the appropriate responsive candidates and check the public requests. This adds an external image service to the workflow; WordPress's native image-size settings and your template code remain separate configuration.

Keep going

Make the media library less work.

See how Vyso brings search, enrichment, cleanup, and delivery into one product.

Start free