Skip to content

Automatically extract image for Schema.org metadata from content if no featured image selected #1845

@westonruter

Description

@westonruter

This came up on https://wordpress.org/support/topic/image-amp/

When a blog post has an image added to the content but does not have any image assigned as the featured image, then GSC will complain about there not being an image supplied. We should automatically scrape the post_content for the first image to use in this case.

Note that Jetpack actually has some similar logic to do this in filtering amp_post_template_metadata: https://github.com/Automattic/jetpack/blob/c126df3d52a9e7e35cb1cefcf64281448d8becd9/3rd-party/class.jetpack-amp-support.php#L129-L174

As with #1812, we should only use an image if it satisfies the required dimensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityChanges that impact accessibility and need corresponding review (e.g. markup changes).EnhancementNew feature or improvement of an existing oneGroomedP2Low prioritySchema.org MetadataWS:CoreWork stream for Plugin corewontfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions