AI Image to WordPress
Generate images with OpenRouter from the WordPress media area, optimize locally, apply SEO filename and readable alt text, then upload directly to Media Library.
by qipihen · github.com/qipihen/ai-image-to-wordpress-plugin · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/qipihen/ai-image-to-wordpress-plugin/archive/refs/heads/main.zipWordPress plugin for AI image generation with OpenRouter. It creates images, compresses them for web performance, applies SEO-friendly filenames, fills readable Alt text, uploads to Media Library, and returns the final image URL.
SEO Keywords
WordPress AI image generator, OpenRouter WordPress plugin, Gemini image generation, image compression plugin, automatic Alt text, SEO filename, featured image generator, image-to-image editing
Features
- Generate images from prompt directly in WordPress admin
- Optional image-to-image editing using Media Library image or external image URL
- OpenRouter model support (default:
google/gemini-3.1-flash-image-preview) - Low-cost metadata model support for natural filename/title/alt (default:
google/gemini-2.5-flash-lite-preview-09-2025) - Local optimization before upload:
- target size (KB)
- max width and min width floor
- JPEG quality loop
- Prompt cache for API savings (reuse existing media on same input)
- Similar-image dedupe before upload (perceptual hash)
- Batch generation (1-6 images in one run, auto-disables cache/dedupe reuse for that run)
- Multi-prompt batch mode (one prompt per line, one generated image per line)
- CSV prompt import (import one prompt per row into Batch Prompts)
- SEO filename format:
{brand}-{keywords}.jpg(no forced timestamp) - Readable Alt/title generated by AI metadata rewriter (with fallback)
- Upload into Media Library and return URL + attachment ID
- Admin entry points:
Media -> AI Generate- Media list quick button
- Media row action
AI Edit - Post/Page editor metabox quick link
- Admin bar quick link
Installation
- Upload folder to:
wp-content/plugins/ai-image-to-wordpress
- Activate AI Image to WordPress in WordPress Plugins.
- Open
Media -> AI Generate. - Save your OpenRouter API key.
- Generate and upload images.
Quick Start
- Enter prompt.
- Optional: choose source image from Media Library or paste external image URL.
- For multiple prompts, fill
Batch Promptswith one prompt per line, or clickImport Prompts CSV(this overrides Batch Count). - Otherwise, use
Batch Countfor one prompt with multiple variations. - Choose usage profile:
content,featured, orhero. - Click Generate and Upload.
- Copy generated image URL(s) and use in posts/pages.
Compatibility
- WordPress: 6.x recommended
- PHP: 8.0+ recommended
- Works with Media Library workflows and page builders (including Elementor)
- Designed to coexist with FileBird because it adds its own generator page/actions instead of replacing media UI
Verification
php -l ai-image-to-wordpress.php
node -e "new Function(require('fs').readFileSync('assets/admin.js','utf8'))"
Security Notes
- OpenRouter key is stored in WordPress options (admin only).
- Use HTTPS and strong admin access controls.
- Keep plugin and WordPress updated.
License
GPL-2.0+