WordPress AI Image Optimizer
Version: 1.2.0 Updated: 2026-06-30 Freshly updated: v1.2.0 replaces per-image respiraupdatemedia loops with a single respiraupdatemediabatch pass (up to ~50 items at once), snapshots the media library with respiragetsnapshot before the batch so the whole run is one-step reversible, runs the audit through respiraanalyzeimages, surfaces optional stock replacements via respirasearchstockimages + respirasideloadimage, and closes with a respiragenerateactivity_report summary (e.g. "optimized 47 images, saved 1.2GB").
AI-powered image optimization for WordPress sites. Automatically compresses, converts formats, renames files, and updates all references. Processes images locally in AI code editor, creates optimized versions, and preserves originals for safety.
What This Skill Does
Scans:
- All media library images
- Images in posts and pages content
- Featured images
- Images in page builder elements (Elementor, Divi, Bricks, etc.)
- WooCommerce product images
- Images in custom post types
Detects:
- File sizes (actual KB/MB on disk)
- Image dimensions (width x height in pixels)
- Format (JPG, PNG, GIF, WebP, AVIF, SVG)
- Whether width/height attributes are set in HTML
- Whether alt text exists (and quality)
- Whether image is being used (orphaned media)
- Whether responsive image sizes exist (WordPress srcset)
- Compression quality (estimated from file size)
- Lazy loading implementation
- Non-SEO-friendly filenames (IMG_1234.jpg, screenshot.png, etc.)
- Oversized originals (5000px uploaded when 2000px is max needed)
- Missing srcset on content images
- Builder images that bypass WordPress responsive system
Optimizes via AI Code Editor:
- Downloads images from WordPress
- Compresses with optimal quality settings (80-85% for JPG, lossless for PNG)
- Converts to modern formats (WebP preferred, AVIF when appropriate)
- Resizes oversized originals to optimal dimensions
- Renames with SEO-friendly descriptive filenames
- Generates missing alt text using AI
- Regenerates WordPress responsive image sizes
- Uploads optimized versions back to WordPress
- Creates new media entries (keeps old files safe)
- Updates all content references in duplicates
Provides:
- Comprehensive image health score (0-100)
- Impact-prioritized optimization opportunities
- Before/after file size comparisons
- Estimated page speed improvements
- Plugin/CDN detection and recommendations
Requirements
- Respira for WordPress plugin installed and connected
- MCP connection active (desktop or WebMCP)
- AI code editor with image processing tools (Claude Code, Cursor, etc.)
- WooCommerce add-on (optional - for product image optimization)
- Read access to scan images, write access to upload optimized versions
How to Use
Trigger Phrase
"optimize my wordpress images with ai"
Alternative Triggers
- "run ai image optimization"
- "compress and optimize all images"
- "audit my media library"
- "improve image performance"
What Happens
Phase 1: Comprehensive Image Audit
- Scans all images across site:
- Media library (all uploaded files) - Content images (posts, pages, custom post types) - Featured images - Builder images (Elementor, Divi, Bricks, etc.) - WooCommerce product images (if WooCommerce active)
- Analyzes each image (use
respiraanalyzeimages to drive the audit; it returns per-image findings in one call):
- File size and format - Actual dimensions vs displayed dimensions - Alt text presence and quality - Filename SEO-friendliness - Usage (which pages/posts use this image) - Responsive image sizes (srcset) - Lazy loading implementation
- Detects optimization plugins/CDN:
- Smush, ShortPixel, EWWW, Imagify, Optimole - Cloudflare, BunnyCDN, other CDNs
- Scores opportunities by impact:
- File size x page traffic = optimization priority - Separates quick wins from big wins
- Generates comprehensive report
Phase 2: User Approval
Presents report and asks which optimizations to run:
- Compress oversized images
- Convert JPG/PNG -> WebP
- Resize unnecessarily large originals
- Rename non-SEO filenames
- Add missing alt text
- Regenerate responsive image sizes
User can choose:
- "Optimize everything" (all optimizations)
- "Compress only" (no format changes)
- "Top 10 images" (highest impact first)
- "Homepage images only" (critical pages first)
Phase 3: AI Processing
- Snapshot the media library before any writes with
respiragetsnapshot so the entire batch is reversible in one step (respirarestoresnapshot). Take this once, before the batch — not per image.
- Downloads images from WordPress to local workspace.
- Processes images locally:
- Compression - Format conversion - Resizing - SEO-friendly renaming - AI alt text generation - Optional: when an image is low quality or simply wrong for the page, find a replacement with respirasearchstockimages and pull it in with respirasideload_image instead of re-optimizing the original
- Uploads optimized versions back to WordPress:
- Creates NEW media entries (original files untouched) - Applies metadata in one pass with respiraupdatemediabatch rather than one respiraupdatemedia call per image. The batch accepts up to ~50 items, so a typical library is updated in a single call (alt text, title, caption, description). Fall back to single respiraupdate_media only for one-off corrections. - Marks old files as "deprecated - replaced by [new-filename]"
- Updates content references in duplicates:
- Creates duplicates of affected posts/pages - Replaces old image URLs with new optimized URLs - Updates builder and WooCommerce image references
- Regenerates responsive image sizes and srcset support
Phase 4: Review & Publish
- Provides before/after comparison:
- File size savings - Format changes - Dimension changes - Filename improvements - Pages affected
- User reviews duplicates in WordPress admin
- User approves publishing
- Old files remain available for safety and rollback
- Generate a run summary with
respiragenerateactivity_report so the work is auditable in one line (e.g. "optimized 47 images, saved 1.2GB, added alt text to 31"). This reads from the change log Respira already recorded for the batch.
Honest Disclaimer
This skill downloads images, processes them with AI, and uploads optimized versions. You review all changes before publishing.
What this skill CANNOT do:
- Guarantee perfect quality (compression is lossy)
- Fix already broken/corrupted image files
- Optimize CSS background images
- Process images hosted externally outside WordPress uploads
- Improve composition/art direction (technical optimization only)
What this skill CAN do:
- Compress images without visible quality loss
- Convert to WebP for significant size reduction
- Resize oversized originals to practical dimensions
- Rename files with SEO-friendly names
- Generate descriptive alt text
- Update references automatically in duplicates
- Preserve originals for safety and rollback
Safety Model
- Non-destructive: Creates NEW optimized images and keeps old files
- Duplicate-first: Updates content in duplicates, never live pages
- User approval required: Review before publishing
- Rollback ready: Old files preserved and reversible
- No live site impact until explicit approval
Technical Details
Uses these Respira MCP tools:
Audit:
respiraanalyzeimages (drives the Phase 1 audit; per-image findings in one call)
Media Operations:
respiralistmedia
respiragetmedia
respirauploadmedia
respiraupdatemedia_batch (primary metadata writer — up to ~50 items per call)
respiraupdatemedia (single-item fallback / one-off corrections)
respiradeletemedia (optional cleanup)
Stock Replacements (optional):
respirasearchstock_images
respirasideloadimage
Snapshot & Rollback:
respiragetsnapshot (capture before the batch)
respirarestoresnapshot (one-step revert)
Reporting:
respiragenerateactivity_report (run summary: images optimized, space saved, alt text added)
Content Scanning:
respiralistpages
respiralistposts
respirareadpage
respirareadpost
respiragetbuilder_info
Content Updates:
respiracreatepage_duplicate
respiracreatepost_duplicate
respiraupdatepage
respiraupdatepost
WooCommerce (optional):
woocommercelistproducts
woocommercegetproduct
woocommerceupdateproduct
Plugin Detection:
Related Skills
- SEO & AEO Amplifier
- WordPress Site DNA
- Mobile Experience Report
Built by Respira Team https://respira.press/skills/wordpress-ai-image-optimizer