Skip to content
Content
Skill

/wordpress-ai-image-optimizer

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

From plugin
respira-wordpress-skills
4351 skills
Install
$ npx -y skills add respira-press/agent-skills-wordpress --skill wordpress-ai-image-optimizer --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/wordpress-ai-image-optimizer

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

wordpress-ai-image-optimizer.SKILL.md
name: wordpress-ai-image-optimizer
description: "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."
license: MIT
metadata:
  author: Respira for WordPress
  author_url: https://respira.press
  version: 1.2.1
  mcp-server: respira-wordpress
  category: performance

WordPress AI Image Optimizer

**Version:** 1.2.1 **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**

1. 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)

2. 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

3. Detects optimization plugins/CDN:

  • Smush, ShortPixel, EWWW, Imagify, Optimole
  • Cloudflare, BunnyCDN, other CDNs

4. Scores opportunities by impact:

  • File size x page traffic = optimization priority
  • Separates quick wins from big wins

5. 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**

6. 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. 7. Downloads images from WordPress to local workspace. 8. 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

9. 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`
Read more
Ships withrespira-wordpress-skills

The community hub for WordPress AI workflows. Skills that run inside Claude Code, Codex, Antigravity, Cursor, and any AI agent that supports Skills + MCP to analyze, audit, optimize, and fix WordPress sites. Built by the community. Curated by Respira.

Get the whole plugin
Stats
43
Stars
8
Forks
Active
Maintenance
JavaScript
Language
MIT
License
2d ago
Last commit
6mo ago
Created

Repo: respira-press/agent-skills-wordpress

Other skills on respira-wordpress-skills.