[wp-trac] [WordPress Trac] #44470: meta property=“og:image” doesn't register if an image is executed via a shortcode in WP Post and Pages

WordPress Trac noreply at wordpress.org
Wed Jun 27 19:13:34 UTC 2018


#44470: meta property=“og:image” doesn't register if an image is executed via a
shortcode in WP Post and Pages
--------------------------+------------------------------
 Reporter:  nlstm         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  4.9.6
 Severity:  critical      |  Resolution:  invalid
 Keywords:  dev-feedback  |     Focuses:
--------------------------+------------------------------

Comment (by jonoaldersonwp):

 I agree in principle that open graph tags should be supported in core.
 They're a basic universal standard, and it's a little embarrassing that WP
 doesn't handle basic representation of content on third party networks
 without a plugin.

 However...

 I'm not convinced that we should be trying to intelligently sniff for
 images in shortcodes, for a number of reasons.
 - We'd have to execute those shortcodes in the process of evaluating
 the_content, which is a bit performance heavy, and messy in multiple
 regards (we have no idea what they'll do / output).
 - We'd then need to parse the resultant HTML to detect any if any images
 exist, and then, try and extract and parse them. This is riddled with
 issues, performance considerations, etc.
 - There are no hints in those images as to whether they're the preferred
 OG image(s), or what their additional attributes (like the ''alt'' or
 dimensions etc) should be, which requires a lot of inference +
 guestimation, and another (albeit minor) performance hit

 Lastly, Open Graph support from the ''platforms'' (Facebook, WhatsApp,
 Twitter, etc) is erratic at best (see my research at https://yoast.com
 /advanced-technical-seo-social-image-ogimage-tags/), so I'm nervous about
 'fudging in' extra images, when our plugin already provides a framework
 for registering and hooking them in.

 I think that your best course of action is probably to identify the use-
 cases where you'd want an open currently only accessible in a shortcode
 reside, and patch the problem for your own requirements, or collaborate on
 an addition/enhancement to the Yoast SEO plugin - I'd love to see some
 use-cases!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44470#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list