WordPress AI Image Optimizer
Version: 1.2.0
Updated: 2026-06-30
Freshly updated: v1.2.0 replaces per-image respira_update_media loops with a single respira_update_media_batch pass (up to ~50 items at once), snapshots the media library with respira_get_snapshot before the batch so the whole run is one-step reversible, runs the audit through respira_analyze_images, surfaces optional stock replacements via respira_search_stock_images + respira_sideload_image, and closes with a respira_generate_activity_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
respira_analyze_images 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
respira_get_snapshot so the entire batch is reversible in one step (respira_restore_snapshot). 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
respira_search_stock_images and pull it in with respira_sideload_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
respira_update_media_batch rather than one respira_update_media 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 respira_update_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
respira_generate_activity_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:
respira_analyze_images (drives the Phase 1 audit; per-image findings in one call)
Media Operations:
respira_list_media
respira_get_media
respira_upload_media
respira_update_media_batch (primary metadata writer — up to ~50 items per call)
respira_update_media (single-item fallback / one-off corrections)
respira_delete_media (optional cleanup)
Stock Replacements (optional):
respira_search_stock_images
respira_sideload_image
Snapshot & Rollback:
respira_get_snapshot (capture before the batch)
respira_restore_snapshot (one-step revert)
Reporting:
respira_generate_activity_report (run summary: images optimized, space saved, alt text added)
Content Scanning:
respira_list_pages
respira_list_posts
respira_read_page
respira_read_post
respira_get_builder_info
Content Updates:
respira_create_page_duplicate
respira_create_post_duplicate
respira_update_page
respira_update_post
WooCommerce (optional):
woocommerce_list_products
woocommerce_get_product
woocommerce_update_product
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
1---2name: wordpress-ai-image-optimizer3description: Use when the user says 'optimize my wordpress images with ai', 'compress and optimize all images', 'audit my media library', or 'improve image performance'. Downloads images, compresses, converts to WebP, resizes and renames locally, re-uploads, and updates every content reference.4license: MIT5---67# WordPress AI Image Optimizer89**Version:** 1.2.010**Updated:** 2026-06-3011**Freshly updated:** v1.2.0 replaces per-image `respira_update_media` loops with a single `respira_update_media_batch` pass (up to ~50 items at once), snapshots the media library with `respira_get_snapshot` before the batch so the whole run is one-step reversible, runs the audit through `respira_analyze_images`, surfaces optional stock replacements via `respira_search_stock_images` + `respira_sideload_image`, and closes with a `respira_generate_activity_report` summary (e.g. "optimized 47 images, saved 1.2GB").1213AI-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.1415## What This Skill Does1617**Scans:**18- All media library images19- Images in posts and pages content20- Featured images21- Images in page builder elements (Elementor, Divi, Bricks, etc.)22- WooCommerce product images23- Images in custom post types2425**Detects:**26- File sizes (actual KB/MB on disk)27- Image dimensions (width x height in pixels)28- Format (JPG, PNG, GIF, WebP, AVIF, SVG)29- Whether width/height attributes are set in HTML30- Whether alt text exists (and quality)31- Whether image is being used (orphaned media)32- Whether responsive image sizes exist (WordPress srcset)33- Compression quality (estimated from file size)34- Lazy loading implementation35- Non-SEO-friendly filenames (IMG_1234.jpg, screenshot.png, etc.)36- Oversized originals (5000px uploaded when 2000px is max needed)37- Missing srcset on content images38- Builder images that bypass WordPress responsive system3940**Optimizes via AI Code Editor:**41- Downloads images from WordPress42- Compresses with optimal quality settings (80-85% for JPG, lossless for PNG)43- Converts to modern formats (WebP preferred, AVIF when appropriate)44- Resizes oversized originals to optimal dimensions45- Renames with SEO-friendly descriptive filenames46- Generates missing alt text using AI47- Regenerates WordPress responsive image sizes48- Uploads optimized versions back to WordPress49- Creates new media entries (keeps old files safe)50- Updates all content references in duplicates5152**Provides:**53- Comprehensive image health score (0-100)54- Impact-prioritized optimization opportunities55- Before/after file size comparisons56- Estimated page speed improvements57- Plugin/CDN detection and recommendations5859## Requirements6061- Respira for WordPress plugin installed and connected62- MCP connection active (desktop or WebMCP)63- AI code editor with image processing tools (Claude Code, Cursor, etc.)64- WooCommerce add-on (optional - for product image optimization)65- Read access to scan images, write access to upload optimized versions6667## How to Use6869### Trigger Phrase70"optimize my wordpress images with ai"7172### Alternative Triggers73- "run ai image optimization"74- "compress and optimize all images"75- "audit my media library"76- "improve image performance"7778### What Happens7980**Phase 1: Comprehensive Image Audit**81821. Scans all images across site:83 - Media library (all uploaded files)84 - Content images (posts, pages, custom post types)85 - Featured images86 - Builder images (Elementor, Divi, Bricks, etc.)87 - WooCommerce product images (if WooCommerce active)882. Analyzes each image (use `respira_analyze_images` to drive the audit; it returns per-image findings in one call):89 - File size and format90 - Actual dimensions vs displayed dimensions91 - Alt text presence and quality92 - Filename SEO-friendliness93 - Usage (which pages/posts use this image)94 - Responsive image sizes (srcset)95 - Lazy loading implementation963. Detects optimization plugins/CDN:97 - Smush, ShortPixel, EWWW, Imagify, Optimole98 - Cloudflare, BunnyCDN, other CDNs994. Scores opportunities by impact:100 - File size x page traffic = optimization priority101 - Separates quick wins from big wins1025. Generates comprehensive report103104**Phase 2: User Approval**105106Presents report and asks which optimizations to run:107- Compress oversized images108- Convert JPG/PNG -> WebP109- Resize unnecessarily large originals110- Rename non-SEO filenames111- Add missing alt text112- Regenerate responsive image sizes113114User can choose:115- "Optimize everything" (all optimizations)116- "Compress only" (no format changes)117- "Top 10 images" (highest impact first)118- "Homepage images only" (critical pages first)119120**Phase 3: AI Processing**1211226. Snapshot the media library before any writes with `respira_get_snapshot` so the entire batch is reversible in one step (`respira_restore_snapshot`). Take this once, before the batch — not per image.1237. Downloads images from WordPress to local workspace.1248. Processes images locally:125 - Compression126 - Format conversion127 - Resizing128 - SEO-friendly renaming129 - AI alt text generation130 - Optional: when an image is low quality or simply wrong for the page, find a replacement with `respira_search_stock_images` and pull it in with `respira_sideload_image` instead of re-optimizing the original1319. Uploads optimized versions back to WordPress:132 - Creates NEW media entries (original files untouched)133 - Applies metadata in one pass with `respira_update_media_batch` rather than one `respira_update_media` 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 `respira_update_media` only for one-off corrections.134 - Marks old files as "deprecated - replaced by [new-filename]"13510. Updates content references in duplicates:136 - Creates duplicates of affected posts/pages137 - Replaces old image URLs with new optimized URLs138 - Updates builder and WooCommerce image references13911. Regenerates responsive image sizes and srcset support140141**Phase 4: Review & Publish**14214312. Provides before/after comparison:144 - File size savings145 - Format changes146 - Dimension changes147 - Filename improvements148 - Pages affected14913. User reviews duplicates in WordPress admin15014. User approves publishing15115. Old files remain available for safety and rollback15216. Generate a run summary with `respira_generate_activity_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.153154## Honest Disclaimer155156This skill downloads images, processes them with AI, and uploads optimized versions. You review all changes before publishing.157158**What this skill CANNOT do:**159- Guarantee perfect quality (compression is lossy)160- Fix already broken/corrupted image files161- Optimize CSS background images162- Process images hosted externally outside WordPress uploads163- Improve composition/art direction (technical optimization only)164165**What this skill CAN do:**166- Compress images without visible quality loss167- Convert to WebP for significant size reduction168- Resize oversized originals to practical dimensions169- Rename files with SEO-friendly names170- Generate descriptive alt text171- Update references automatically in duplicates172- Preserve originals for safety and rollback173174## Safety Model175176- Non-destructive: Creates NEW optimized images and keeps old files177- Duplicate-first: Updates content in duplicates, never live pages178- User approval required: Review before publishing179- Rollback ready: Old files preserved and reversible180- No live site impact until explicit approval181182## Technical Details183184Uses these Respira MCP tools:185186**Audit:**187- `respira_analyze_images` (drives the Phase 1 audit; per-image findings in one call)188189**Media Operations:**190- `respira_list_media`191- `respira_get_media`192- `respira_upload_media`193- `respira_update_media_batch` (primary metadata writer — up to ~50 items per call)194- `respira_update_media` (single-item fallback / one-off corrections)195- `respira_delete_media` (optional cleanup)196197**Stock Replacements (optional):**198- `respira_search_stock_images`199- `respira_sideload_image`200201**Snapshot & Rollback:**202- `respira_get_snapshot` (capture before the batch)203- `respira_restore_snapshot` (one-step revert)204205**Reporting:**206- `respira_generate_activity_report` (run summary: images optimized, space saved, alt text added)207208**Content Scanning:**209- `respira_list_pages`210- `respira_list_posts`211- `respira_read_page`212- `respira_read_post`213- `respira_get_builder_info`214215**Content Updates:**216- `respira_create_page_duplicate`217- `respira_create_post_duplicate`218- `respira_update_page`219- `respira_update_post`220221**WooCommerce (optional):**222- `woocommerce_list_products`223- `woocommerce_get_product`224- `woocommerce_update_product`225226**Plugin Detection:**227- `respira_list_plugins`228229## Related Skills230231- SEO & AEO Amplifier232- WordPress Site DNA233- Mobile Experience Report234235---236237Built by Respira Team238https://respira.press/skills/wordpress-ai-image-optimizer