From the GEO Lab technical guides — where we optimised 112 images from 6.8MB PNGs to <100KB WebPs in one session.
Optimize images for page speed and SEO, upload to WordPress, set all metadata fields, and set as featured image.
One command replaces a 5-minute manual process per image:
- Analyses original image (dimensions, format, size)
- Resizes to 1200px width if larger
- Converts to WebP (quality 80, ~95% size reduction)
- Uploads to WordPress via REST API
- Sets all 4 SEO metadata fields (title, alt, caption, description)
- Optionally sets as featured image on a post
- Clears Nginx cache
- Verifies OG image tag on live page
cp image-seo.md ~/.claude/commands/image-seo.md/image-seo path/to/image.png 1234
Where 1234 is the WordPress post ID to set as featured image (optional).
For multiple images:
/image-seo image1.png image2.png image3.png 1234
| Field | Rules |
|---|---|
| Title | Descriptive, includes keyword, 50-70 chars |
| Alt text | Keyword-rich, describes image, 50-90 chars |
| Caption | Visible on page, provides context, ≥20 chars |
| Description | For media library and image sitemap, ≥20 chars |
- Python 3 with Pillow (
pip install Pillow) - WordPress with Application Passwords
- SSH access to VPS (for cache clearing)
Built by Artur Ferreira | X | LinkedIn