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-onlyRetrieves 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.
More Imagify abilities
Bulk optimize
Schedules a bulk image-optimization run across the WordPress media library or Imagify's custom folders.
Generate missing next-gen versions
Queues generation of missing WebP/AVIF versions for every already-optimized image on the site.
Get account status
Reports the connected Imagify account's plan, quota consumption, and API key validity.
Get next-gen format coverage
Reports how many optimized images are still missing a next-gen (WebP/AVIF) version and which next-gen format is configured.
Get optimization statistics
Returns aggregate optimization savings for both WordPress media and custom (non-Media-Library) folders.
Get plugin settings
Returns Imagify's current configuration options, with the API key redacted.