feat: convert unsupported featured image formats for Google Business#1086
Open
vytisbulkevicius wants to merge 1 commit into
Open
feat: convert unsupported featured image formats for Google Business#1086vytisbulkevicius wants to merge 1 commit into
vytisbulkevicius wants to merge 1 commit into
Conversation
Google Business Profile does not accept WebP images, so posts with a WebP featured image were shared without their image. When the featured image is a WebP file in the uploads directory, convert a JPEG copy and use that URL. Any other case (supported format, remote image, conversion failure) keeps the original URL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Soare-Robert-Daniel
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google Business Profile (GMB) doesn't support WebP images, so posts whose featured image is a WebP file were shared without an image. GMB hands Google an image URL to fetch, so the fix is to give it a non-WebP URL.
When the featured image is a WebP file in the local uploads directory, a JPEG copy is created (via
wp_get_image_editor) and its URL is used. For any other case — an already-supported format, a remote/CDN image, or a conversion failure — the original URL is returned unchanged, so behaviour is never worse. The unsupported-format list is filterable (rop_gmb_unsupported_image_formats).Will affect the visual aspect of the product
NO
Test instructions
.webpimage as a post's featured image.…-rop-gmb.jpgsibling is created in uploads).Check before Pull Request is ready:
Closes https://github.com/Codeinwp/tweet-old-post-pro/issues/439