Get media optimization status is a WordPress ability from Imagify — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Get media optimization status

Read-only
Imagify Content & Tools imagify/get-media-status

Retrieves the optimization status and size metrics for a single media library attachment.

Requires the Imagify plugin on WordPress 6.9+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). Most abilities are gated by the Imagify 'manage' capability, resolved through Imagify's own capability abstraction (honors the imagify_capacity filter and multisite network-admin logic; equivalent to manage_options by default); the bulk-optimize, generate-missing-nextgen, and restore-media abilities instead check the WordPress 'manage_options' capability directly.

What it does

This ability looks up one WordPress media attachment by ID and returns whether Imagify has optimized it ('success', 'error', or 'unoptimized'), the optimization level used (lossless, aggressive, or ultra), the original and optimized file sizes in bytes, whether a WebP and/or AVIF version of the full-size image exists, and any error message if optimization failed. It takes no action on the media itself. Use it to check the outcome of a specific image after upload or after calling optimize-media, without opening the Media Library UI.

See it in action

You ask your AI assistant

"Has attachment #4821 been optimized by Imagify yet, and does it have a WebP version?"

Inputs

Name Type Required Description
media_id integer Yes The WordPress attachment ID to check.

Returns

An object with 'status' (success/error/unoptimized), 'optimization_level' (0, 1, 2, or null if unoptimized), 'original_size' and 'optimized_size' in bytes, 'webp_available' and 'avif_available' booleans, and 'error_message' (null unless status is error).

Permission

The current user must have the Imagify 'manage' capability.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.