Skip to content

Generating Featured Images from Post Content

Learn how to automatically use the first image from your post content as the featured image. This is the most common and efficient method.

Overview

The "Find in post" method scans your post and automatically selects the first suitable image to use as the featured image. No manual intervention required.

How First-Image Detection Works

The Detection Process

  1. Post is Published/Updated — Plugin hook is triggered
  2. Content is Parsed — HTML content is scanned for image tags
  3. Images are Validated — File format and accessibility are checked
  4. First Valid Image is Selected — Set as featured image and imported to Media Library if needed

Supported Image Formats

JPEG/JPG — Most common format, best for photos ✓ PNG — Supports transparency, best for graphics/logos ✓ GIF — Animated GIFs supported ✓ WebP — Modern format with excellent compression (requires WordPress 5.8+)

Not Supported: ✗ SVG, BMP, TIFF, Base64 encoded images, CSS background images

Setting Up Content-Based Generation

Step 1: Enable the Feature

  1. Go to Auto Featured Image > Settings > General tab
  2. Select "Find in post" as the generation method
  3. Click Save Settings

Step 2: Configure Image Settings

You can configure the output image format and dimensions under Auto Featured Image > Settings > Image Settings tab:

  • Image format: Choose between JPEG or PNG
  • Image size: Set width and height in pixels (default: 800x600)

How It Works with Different Editors

WordPress Block Editor (Gutenberg)

Supported Blocks:

  • ✓ Image block
  • ✓ Gallery block (first image)
  • ✓ Cover block (background image)
  • ✓ Media & Text block

Classic Editor

  • ✓ Standard <img> tags
  • ✓ Images inserted via Add Media
  • ✓ Images in HTML blocks

Page Builders

  • Elementor: ✓ Image widgets, ✓ Image Box widgets
  • Divi: ✓ Image modules, ✓ Gallery modules
  • WPBakery: ✓ Single Image elements, ✓ Image Gallery elements

Note: Background images set via CSS are generally not detected by any editor or page builder.

Image Selection Rules

When multiple images exist in your post content, the plugin selects the first valid image from top to bottom.

The plugin automatically skips:

  • Icons and Logos — Detected by class names (.icon, .logo) or very small size (<100px)
  • Tracking Pixels — 1x1 pixel images
  • Advertisement Images — Common ad network domains

Handling External Images

External images (hosted on other domains) can be handled in two ways:

Option 1: Import to Media Library (Recommended)

  • Plugin downloads the external image and saves it to your /wp-content/uploads/ folder
  • Prevents broken links if the source removes the image
  • Full control over images and better performance

Option 2: Use External URLs Directly

  • Saves server storage but images can break if the source removes them
  • Not recommended for production sites

Troubleshooting

No Image Detected Despite Having Images

  • Verify your post content contains standard <img> tags (CSS background images are not detected)
  • Ensure the image format is JPG, PNG, GIF, or WebP
  • Check the Plugin Logs tab for any errors
  • Test with a simple post containing a single image

Wrong Image Selected

  • The first image in the HTML source may not be the visually first image (especially with page builders)
  • Fix: Move the desired image to the top of your content, or manually set the featured image for that post

External Images Not Importing

  • The remote server may be blocking requests, or PHP may be timing out
  • Try downloading the image manually and uploading it to your Media Library

Best Practices

  1. Place your most important image first — the plugin uses the first valid image it finds
  2. Optimize images before adding to content — resize to 1200-2000px width and compress using tools like TinyPNG
  3. Use descriptive file names and alt text — improves accessibility and SEO
  4. Use consistent image sizes across posts for a professional, predictable layout

Need Help?