Intelligent Open Graph meta tags with automatic image fallback from AVIF/WebP to JPEG/PNG for social media crawlers.
Plugin version:
WordPress minimum version:
WordPress tested up to:
PHP version (or superior):
Price:
Download:
Description
Social media crawlers — Facebook, Twitter/X, LinkedIn, WhatsApp — do not support modern image formats such as AVIF and WebP. When a post’s featured image uses one of these formats, the platform shows a broken or missing image preview.
OpenGraph (by ROBOTSTXT) outputs a complete set of Open Graph and Twitter Card meta tags and solves the format incompatibility automatically. It detects whether each post’s featured image is in a supported format and, when needed, resolves and caches a compatible JPEG or PNG alternative.
How it works:
- A visitor (or social media crawler) requests a page.
- The plugin checks whether the post’s featured image is in AVIF, WebP, or another unsupported format.
- If so, it locates a JPEG or PNG version of the same image using HTTP HEAD requests.
- The result is cached in postmeta so subsequent requests are instant.
- The resolved image is injected into
og:image(and related) meta tags.
Key features:
- Full Open Graph meta tag output:
og:title,og:type,og:url,og:description,og:site_name,og:locale,og:image,og:image:width,og:image:height,og:image:type,og:image:alt - Article-specific tags:
article:published_time,article:modified_time,article:section,article:tag - Twitter Card tags:
twitter:card,twitter:site,twitter:image - Automatic format detection — AVIF, WebP, GIF, BMP, SVG, TIFF
- HTTP HEAD-based image verification (no file downloads)
- Per-post custom OG title and description override (post editor meta box)
- Global fallback image URL and homepage-specific image URL
- Cached results in postmeta for performance, with automatic invalidation on featured image change
- Negative caching for failed resolutions (1-hour transient)
- Integration with Yoast SEO and RankMath (no duplicate tags)
- Taxonomy archive image support via developer filter
- Admin panel with Settings, Tools, and Diagnostics tabs
- WP-CLI commands for batch operations
- REST API endpoints for programmatic access
- Multisite compatible (per-site configuration)
- Full internationalization support (es_ES and ca included)
Using the plugin
WP-CLI
List available commands:
wp og-fallback --help
Resolve the fallback image for a single post:
wp og-fallback resolve 123
Re-resolve all posts (clears cache first):
wp og-fallback resolve --all
Dry-run re-resolution without saving:
wp og-fallback resolve --all --dry-run
Re-resolve all posts of a specific type:
wp og-fallback resolve --all --post-type=page
Clear cache for a single post:
wp og-fallback clear-cache 123
Clear all cached fallback URLs:
wp og-fallback clear-cache --all
REST API
The plugin exposes two REST API endpoints under the robotstxt-og/v1 namespace. Both require the edit_others_posts capability (editor and above).
Force re-resolve a post’s fallback image:
POST /wp-json/robotstxt-og/v1/resolve/{post_id}
Returns: { post_id, resolved_url, cached, success }
Get current cached status for a post:
GET /wp-json/robotstxt-og/v1/status/{post_id}
Returns: { post_id, cached_url, original_url, has_cache }
Extra Configurations
Developer filters available in functions.php or a custom plugin:
Disable external image resolution:
add_filter( 'robotstxt_og_external_image_enabled', '__return_false' );
Adjust HEAD request timeout (seconds, default: 5):
add_filter( 'robotstxt_og_external_image_timeout', fn() => 10 );
Provide an OG image for taxonomy archives:
add_filter( 'robotstxt_og_taxonomy_image', fn( $url, $term_id ) => wp_get_attachment_url( get_term_meta( $term_id, 'my_image_id', true ) ), 10, 2 );
Enable debug logging to debug.log:
add_filter( 'robotstxt_og_enable_logging', '__return_true' );