CompressX Documentation

Everything you need to install, configure, and get the best performance from CompressX Free and Pro.

CompressX Docs
Document Notice

Help Improve the Documentation

If you notice something unclear, outdated, or incorrect, feel free to let us know.

Your feedback helps keep the documentation accurate and useful for everyone.

How to Use Media Replacement

Feb 9, 2026 | Docs

This guide walks you through the steps to replace an existing image using Media Replacement.

Step 1: Access Media Replacement

There are two ways to open the Media Replace page in CompressX.
You can use any of the following entry points, depending on your workflow.

Option 1: From “Edit Media” (Attachment Edit Screen)

Edit Media page
If you open an attachment in WordPress and click Edit Media (often used together with the WordPress image editor):

  • 1. Go to Media Library and click Edit under an image.
  • 2. On the Edit Media page, locate the CompressX Replace Media panel on the right.
  • 3. Click Upload & Replace Media File to open Media Replace.

Use this entry point when you are already editing media details or using the WordPress image editor workflow.

Option 2: From Media Library (Direct “Media Replace” Link)

Media Library - Replace Media
You can also open Media Replace directly from the Media Library:

  • 1. Go to Media Library.
  • 2. Switch to List View (or use the available quick actions).
  • 3. Click the Media Replace link for the target media item.

This is the fastest entry point when you already know which file you want to replace.

Step 2: Review Current Compression Settings

The Current Compression Settings shown here reflect your global configuration in the Image Optimization page.
To change how images are optimized during replacement, update the settings in Image Optimization first. Media Replace will then use those settings automatically.

Step 3: Configure Replacement Options

Auto Re-optimize After Replacement

When enabled, CompressX will:

  • Regenerate all WordPress-generated thumbnails
  • Re-apply compression and optimization automatically

This option is recommended for most use cases.

Thumbnail Generation Strategy

Choose how thumbnails should be regenerated:

  • Use current default sizes and fill missing ones (Recommended)
    Uses the current WordPress thumbnail settings and generates any missing sizes.

    Example:
    An image was originally uploaded when WordPress generated a 640×480 thumbnail.
    Later, your theme changed and the current thumbnail sizes are 300×300 and 1024×768, while 640×480 is no longer part of the default sizes.
    When replacing the image with this option selected:

    • Thumbnails are regenerated for the current sizes (300×300, 1024×768)
    • The previously used size (640×480) is also regenerated if it is still referenced by existing pages

    This ensures both current layouts and existing references continue to work correctly.

  • Match original thumbnail sizes
    Regenerates thumbnails strictly based on the original image’s thumbnail sizes.

    Example:
    An image originally had thumbnails generated at 640×480 and 800×600.
    Even if the current WordPress settings now define different sizes, only 640×480 and 800×600 will be regenerated, and no new sizes will be created.

Select the option that best matches your layout requirements.

Step 4: (Pro) Configure Temporary Version Retention

This step is available in CompressX Pro.

  • Keep temporary versions of previously replaced images
  • Set how many versions are retained
  • Define how long they are kept before automatic removal

Temporary versions allow you to restore a recently replaced image if needed.

Step 5: Review Current Media Information

The Current Media section shows details of the existing image.

Tip
Before uploading a replacement image, take a moment to note the original file format (such as JPG or PNG), as the replacement file must use the same format.

Step 6: Upload the New Media

In the New Media section, click to upload or drag & drop a new image.

Important: File Format Requirement
The replacement image must use the same file format as the original media
(e.g. JPG → JPG).

Step 7: Complete the Replacement

After uploading the new image, confirm the settings and click Replace Media.
When the process completes, the page will automatically redirect to the Media Editor page of the attahcment.

Tips & Best Practices

  • Use images with similar dimensions to avoid layout shifts
  • Keep Auto Re-optimize enabled unless you have a specific reason not to
  • Allow time for CDN or browser cache updates
  • Use temporary versions for quick rollback, just in case, not long-term storage