Currently, when a featured image is generated using the AI image generation feature, the image is saved with a default filename in the format:
ai-generated-image-<timestamp>
This naming approach lacks context and does not provide meaningful information about the image content.
Problem
- Filenames are not descriptive or SEO-friendly
- Difficult to identify images in the media library
- No indication of image context/content
Expected Behavior
Generated images should include:
- A consistent prefix to indicate AI origin
- A descriptive, human-readable context (based on post title or content)
- A timestamp (or unique identifier) for uniqueness
Proposed Filename Format
ai-generated-image-<context>-<timestamp>.jpg
Examples
Post Title: "10 Tips to Improve Email Marketing"
ai-generated-image-email-marketing-tips-1712674832.jpg
Post Title: "WordPress SEO Guide"
ai-generated-image-wordpress-seo-guide-1712674832.png
Proposed Solution
-
Extract context from:
- Post title (preferred), or
- Key phrases from content
-
Convert context into a slug:
- Lowercase
- Hyphen-separated
- Remove special characters
-
Prefix filename with ai-generated-image-
-
Append timestamp or unique hash for collision avoidance
-
Ensure compatibility with WordPress media handling
Additional Enhancements
-
Allow developers to modify filename via a filter/hook
-
Limit context length (e.g., 5–8 words) to avoid overly long filenames
-
Ensure fallback to:
ai-generated-image-<timestamp>
if context extraction fails
Acceptance Criteria
Impact
- Improves media library organization
- Enhances SEO and readability of filenames
- Clearly distinguishes AI-generated images from other uploads
- Provides better context for users and developers
Currently, when a featured image is generated using the AI image generation feature, the image is saved with a default filename in the format:
This naming approach lacks context and does not provide meaningful information about the image content.
Problem
Expected Behavior
Generated images should include:
Proposed Filename Format
Examples
Post Title: "10 Tips to Improve Email Marketing"
Post Title: "WordPress SEO Guide"
Proposed Solution
Extract context from:
Convert context into a slug:
Prefix filename with
ai-generated-image-Append timestamp or unique hash for collision avoidance
Ensure compatibility with WordPress media handling
Additional Enhancements
Allow developers to modify filename via a filter/hook
Limit context length (e.g., 5–8 words) to avoid overly long filenames
Ensure fallback to:
if context extraction fails
Acceptance Criteria
ai-generated-image-<context>-<timestamp>formatImpact