CompressX
  • Home
  • User Guide
  • My account
  • Cart
  • Pricing
Select Page

CompressX Free

1
  • CompressX: Free

How To

3
  • Config Apache .htaccess Rules
  • Config Nginx .htaccess Rules
  • TroubleShooting

Thumbnails Regen

1
  • Thumbnails Regeneration

WP-CLI Support

1
  • WP-CLI Support

Roles & Capabilities

1
  • Roles & Capabilities

CDN Integration

1
  • CDN Integration

Advanced Settings

1
  • Cron

Watermark

1
  • Watermark

Wordpress MU Support

1
  • WordPress MU Support
View Categories
  • Home
  • Documentations
  • WP-CLI Support
  • WP-CLI Support

WP-CLI Support

1 min read

Description #

CompressX Pro supports WP-CLI to facilitate your image optimization process.

With WP-CLI integration, you can easily convert images in your WordPress media library or a specific image to WebP/AVIF format, and delete converted images with a single command.

How to Convert Images using WP-CLI #

Connect to your server via SSH #

Log in to your website server from your preferred terminal.

Access the website root directory #

Use the command below to access the website root directory:

cd /var/www/html/yourdomain.com/wordpress

Scan for unconverted images #

Scan the WordPress media library and find all unconverted images:

wp compressx scan

Convert all images to WebP/AVIF format #

Convert all images in the WordPress media library to WebP/AVIF format:

wp compressx convert

Convert a specific image to WebP/AVIF format #

Convert a specific image to WebP/AVIF format by image ID.

wp compressx convert --type single --image=id

Note:

To find the image ID, in WordPress’s Media Library list view, hover over the image title and look at the URL that appears in the bottom-left corner of the browser window.

The URL will look something like this: ...post=123.... The number after post= is the image ID.

Delete all converted images #

Delete all converted WebP/AVIF images.

wp compressx delete

Delete converted images for a specific image #

Delete all converted WebP/AVIF images for a specific image.

wp compressx delete --type single --image=id
Updated on February 25, 2025
Table of Contents
  • Description
  • How to Convert Images using WP-CLI
    • Connect to your server via SSH
    • Access the website root directory
    • Scan for unconverted images
    • Convert all images to WebP/AVIF format
    • Convert a specific image to WebP/AVIF format
    • Delete all converted images
    • Delete converted images for a specific image

Our Plugins

  • CompressX Free
  • WPvivid Backup & Migration Free
  • WPvivid Staging Pro
  • WPvivid Database Merging
  • WPvivid Extension for MainWP

CompressX is a product created by WPvivid. It enables you to easily convert JPG/PNG images to WebP and AVIF, and compress WebP and AVIF.
If you have any questions, please contact us.

Pages

  • Contact Us
VPSrobots Inc - US registered company. Privacy Policy | Terms of Service
Loading...

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.