Understanding How Auto Featured Image Works
Learn the core logic behind Auto Featured Image so you can make the most of its features and troubleshoot issues effectively.
Overview
Auto Featured Image automatically assigns featured images to your WordPress posts based on configurable rules. Understanding how it works helps you optimize your content workflow.
How the Plugin Detects Images in Posts
Content Parsing Process
When a post is saved or updated, the plugin:
- Scans Post Content - Parses the post HTML/content
- Identifies Images - Looks for
<img>tags and WordPress image blocks - Validates Images - Checks if images meet minimum requirements
- Selects Best Match - Applies priority rules to choose the featured image
What Images Are Detected?
✓ Supported:
- WordPress Media Library images
- Gutenberg image blocks
- Classic editor
<img>tags - Images in custom HTML blocks
- Gallery images
✗ Not Supported:
- Background images (CSS)
- Images in iframes
- Base64 encoded images
- SVG files (in most configurations)
Priority Order: How Images Are Selected
Default Priority System
The plugin uses this priority order when multiple options exist:
- Existing Featured Image - Never overrides if one is already set (plugin skips posts with existing featured images)
- First Content Image - First valid image found in post content
- Title-Generated Image - Creates image from post title (if enabled)
- Stock Image Search - Fetches from external APIs (if enabled)
- Default/Fallback Image - Uses site-wide default (if configured)
First Image Selection Rules
When using "First Image from Content" method:
- Scans content from top to bottom
- Uses existing Media Library attachments when available
- Can import external images to Media Library
When Images Are Generated
Automatic Generation Triggers
Images are generated automatically based on your settings:
On Publish
- Triggers when post status changes from draft to published
- Runs immediately during the publish action
- Only processes posts without existing featured images
Draft → Publish = AUTO FEATURED IMAGE ASSIGNEDOn Update
- Triggers when an existing post is updated
- Can be configured to run on every update or only when missing
- Useful for posts updated with new images
Post Updated + No Featured Image = AUTO FEATURED IMAGE ASSIGNEDBulk Generation
- Manual trigger for processing multiple posts
- Runs on existing published posts
- Can filter by date, category, post type
Manual Generation Options
You can also trigger generation:
- Individual Post - Click "Generate Featured Image" button in post editor
- Bulk Tool - Process multiple posts from plugin settings
- Quick Edit - Works with WordPress quick edit feature
What Happens Behind the Scenes
Technical Process Flow
1. USER ACTION (Publish/Update)
↓
2. PLUGIN HOOK ACTIVATED
↓
3. CHECK: Does post have featured image?
├─ YES → Skip (unless override enabled)
└─ NO → Continue
↓
4. APPLY GENERATION METHOD
├─ First Image: Scan content
├─ Title Image: Generate graphic
└─ Stock Image: API call
↓
5. VALIDATE IMAGE
├─ Check format
├─ Check dimensions
└─ Check accessibility
↓
6. SET FEATURED IMAGE
├─ Add to Media Library (if external)
├─ Update post meta
└─ Generate thumbnails
↓
7. COMPLETEGeneration Methods Explained
Method 1: First Image from Content
How it works:
- Parses post HTML
- Extracts first
<img>tag or image block - Uses existing Media Library attachment if available
- Downloads and imports external images (optional)
Best for: Blogs, news sites, content-heavy sites
Method 2: Generate from Title
How it works:
- Uses PHP GD Library or ImageMagick
- Creates image canvas with specified dimensions
- Overlays post title text
- Applies styling (fonts, colors, positioning)
Best for: Text-based content, podcasts, announcements
Method 3: Stock Image Search
How it works:
- Sends search query (usually post title or tags)
- Queries APIs (Unsplash, Pixabay)
- Downloads best match
- Imports to Media Library
Best for: Visual content, magazines, lifestyle blogs
Common Scenarios
Scenario 1: New Post with Images
User writes post → Adds 3 images → Clicks Publish
→ Plugin detects first image → Sets as featured imageScenario 2: Existing Post without Images
User updates old post → No images in content
→ Plugin generates title-based image → Sets as featured imageScenario 3: Post Already Has Featured Image
User updates post → Featured image already exists
→ Plugin skips (default) OR overwrites (if override enabled)Performance Considerations
Resource Usage
- Memory: Image processing requires PHP memory (256MB recommended)
- Processing Time: Typically <1 second per image
- API Calls: Stock image searches count against API quotas
- Storage: Generated/downloaded images stored in Media Library
Optimization Tips
- Use "First Image" method for fastest performance
- Limit bulk operations to 50-100 posts at a time
- Enable caching for stock image searches
- Compress images before uploading to content
Understanding Plugin Behavior
What the Plugin Does NOT Do
✗ Replace existing featured images (unless override enabled) ✗ Modify original post content ✗ Delete images from Media Library ✗ Change image file names or URLs ✗ Automatically optimize image file sizes
What the Plugin DOES Do
✓ Assigns featured images automatically ✓ Imports external images to Media Library ✓ Generates new images from titles ✓ Respects WordPress thumbnail settings ✓ Works with custom post types
