• Resolved Harry

    (@dibbyo456)


    New: WP CLI support for bulk/single image Smush and bulk restore

    How can I use it? What’s the command?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Harry

    (@dibbyo456)

    Update: Never mind. I found it. Incase anyone looking for the same, here we go..

    # Smush all images.
    $ wp smush compress
    *
    # Smush single image with ID = 10.
    $ wp smush compress –type=single –image=10
    *
    # Smush first 5 images.
    $ wp smush compress –type=batch –image=5

    wp smush compress

    // OPTIMIZE IMAGES //
    ## OPTIONS

    [–type=<type>]
    : Optimize single image, batch or all images.

    default: all
    options:
    – all
    – single
    – batch

    [–image=<ID>]
    : Attachment ID to compress.

    default: 0

    ## EXAMPLES

    # Smush all images.
    wp smush compress

    # Smush single image with ID = 10.
    wp smush compress –type=single –image=10

    # Smush first 5 images.
    wp smush compress –type=batch –image=5

    // LIST UNOPTIMIZED IMAGES //
    ## OPTIONS

    [<count>]
    : Limit number of images to get.

    ## EXAMPLES

    # Get all unoptimized images.
    wp smush list

    # Get the first 100 images that are not optimized.
    wp smush list 100

    @subcommand list
    @when after_wp_load

    // RESTORE IMAGES //
    ## OPTIONS

    [–id=<ID>]
    : Attachment ID to restore.

    default: all

    ## EXAMPLES
    # Restore all images that have backups.
    wp smush restore

    # Restore single image with ID = 10.
    wp smush restore –id=10

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use Smush CLI?’ is closed to new replies.