[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 22:02:59 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:  reopened
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Editor                    |     Version:  4.9.6
 Severity:  critical                  |  Resolution:
 Keywords:  dev-feedback needs-patch  |     Focuses:
--------------------------------------+------------------------------
Changes (by nlstm):

 * keywords:  dev-feedback => dev-feedback needs-patch
 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 I'm going to always continue to respond and move forward on this issue,
 until I can either solve it, or a lot of research has been produced, I am
 moving forward with trying to gain continued attention to this matter and
 or prove it unworkable with Wordpress Core, because Open Graph
 Functionality is a primary focus of marketing work being done on websites.
 Firstly, Yoast CANNOT parse any shortcodes that execute images, to
 register the image source in the <head> metas, show me a filter or an
 example that can and I will admit defeat. From what I can tell that issue
 was first defined on the internet in November 2016 found here -->
 https://github.com/Yoast/wordpress-seo/issues/6110

 I did also infact test older versions of yoast 2.5.3 and --> v3.0.4 and I
 think was updated on November 25th 2015 which deprecated a lot of yoast
 add filter settings, I mention that because something in my continued
 research pointed me to trying to use that version to avoid the shortcode
 execution problem I was having. I guess I dont know how to explain my
 thought process on that at this point, I just know it didnt work, maybe
 because I thought it did before November 2015, but that was also a way
 earlier version of wordpress core as well too. Regardless though.


 To respond to @webdados I respectfully disagree with your humble opinion.
 Your plugin by default as well as yoast and every other single plugin for
 Open Graphs, and every single piece of functional code for open graphs all
 in which accomplish the same task, by default picks up the image src if
 they are hard coded in the post or manually inserted into page editor.

 og:Image size metas and og:alt metas are removed from the head in the
 known plugins if the developers remove the html attributes for them
 anyways by default, so it doesnt matter on that point either, plus the
 social media platforms with their OG protocols are intelligent enough to
 know the size of the image without attributes as well as know if an alt or
 title is present or not. The Image Size and image alt and title metas are
 important to use through for SEO and to basically crop the image for
 facebook manually and detail better information for the fb protocols so
 they don’t do it manually for you.

 @webdados Your comment is asking developers to perform tedious work and
 tasks in which we should have automated in which your plugin does so as
 well as yoast does it too right but again only if manually placed in the
 post editor?? But now youre saying if a shortcode placed in the page or
 post editor that we have to manually set the image through both of your
 heavily loaded post-editor meta boxes, that I like to disable portions of
 anyways by theme default. And but, as far as I can tell, both yoast and
 every other plugin that allows us to set the image which is fairly nice to
 be able to do for less skilled developers, you can only set 1 image, Which
 destroys an ability to create sliding image carousels on facebook and
 other more intelligent features you can do, that essentially can be
 automated, because you can only by default set 1 image per post with all
 these OG plugins. Having multiple OG image metas is important to have in
 the head section, because when you push the link out to facebook or other
 social platforms including google and bing, you can adjust there very
 quickly on their platforms if you want them removed before you click the
 share and post button, which means 99% of the work is done for you.

 Again, so if you have to manually set an image because your plugins wont
 parse shortcodes that contain hardcoded images, and the shortcode is
 inserted into the post-editor, then the only workable alternative is to
 hardcode and write content the old fashioned way, again meaning no php
 functionality executed within the post editor will work with OG metas on
 your plugins.

 Adding multiple images manually the old fashioned traditional Wordpress
 way through the post editor, it's tedious work and not worth it. If I have
 to manually set the images that I want on 300 page websites, I mean thatd
 be a complete trip to hell maybe ya know.

 This is the suggestion I am trying to make, is there anything that a
 plugin developer can do within your theme functions to make this work with
 OG plugins or to create your own og plugin or functions to make this work
 WITHOUT modifying any wordpress core files? If it is impossible to do so
 then it is a wordpress CORE issue or an issue with the most widely used
 plugin in the world Yoast.

 You have to have the ability to USE SHORTCODES in the post editor and
 still get the same functionality. Again Even with STOCK WORDPRESS
 SHORTCODE FOR THEIR OWN IMAGE GALLERY SHORTCODE [gallery ids=”1, 2, 3,”]
 will not automatically parse on any know OG plugin.

 Lastly, a Marketing tip and GOOD Practice to always follow, if you intend
 on sharing post and page links to facebook or other social networks, like
 many many do, then you want to organize your images, on your post from top
 to bottom structuring in an intelligent and ordered way, (which is the
 default way yoast and other og plugins parse the content anyways) also
 good for SEO on search engines as well, to understand that the first image
 inserted is your featured image, then your 2nd image inserted is you
 second featured image and so on, and in that way you automate the OG
 protocols on facebook, as mentioned earlier before you hit the post button
 on facebook or other Social Post-Pushing plugins like JETPACK, you can
 remove certain pictures, instead of trying to find the ones you want to
 use and manually insert them the way @webdados suggested or yoast allows
 too. The only reason yoast and og plugins have that feature is to override
 the images contained in the content if you want to.

 And as far as what @jonoaldersonwp suggested about some of cumbersome
 problems associated with what I want to get accomplished here, hes not
 necessarily wrong that it is infact cumbersome for a plugin developer to
 do and get streamlined, so I push it to WORDPRESS CORE to adjust the way
 it interprets shortcodes in the post-editor to be able to pull the array
 of images from the content and their attributes the same way It does for
 the [gallery ids=”1,2,”] shortcode and grant the ability to editor to
 understand that is code first before it is outputed and executed I think
 maybe. Which logically if I think about this all correctly is leading me
 again to believing this to be a wordpress core issue because it cannot
 interpret an array of images in the content if it is a shortcode not even
 for their own gallery shortcodes. I HATE this that theirs no known good
 solution you have to use shortcodes in wordpress if youre ever going to
 place well crafted and dynamic code in the post-editor.

 Wordpress core might have to ability to make some changes to the tinymce
 post editor and grant the ability for the Post-Page Visual Editor to
 understand very intelligently the content being inserted via a SHORTCODE,
 because I think if that can be accomplished by Wordpress CORE default then
 no filters or modifications ever have to be made by theme and plugin
 developers, which is suggesting that wordpress core should and ought to
 consider caring because a primary focus of wordpress is to push content to
 the search engines and social networks, which also means wordpress core
 doesnt have to enable OG protocols they just have to more intelligently
 understand what the contents of a shortcode are within the wordpress admin
 post editor before it is executed on the front-end, I THINK maybe. Thanks
 for reading and caring. This is the worst issue Ive ever faced with
 wordpress. I’m probably going to continue to light of the internet on
 this, until someone cares as much as I do about it or can prove their is a
 known solution to at least the [gallery] shortcode as a simple test. If a
 filter can be added to fix this with the og: plugins ill cave, plus im
 sure developers will be interested in knowing about this issue and want
 patches and fixes for the future, if wordpress core cant do it. And again
 I strongly disagree with what @webdados, because the best practice is to
 by default get the images from the content section of the site only per
 post or page, having to manually add filters to a website on a per post
 and per page is what I think you were suggesting is a bad practice, and
 only good for maybe small websites 10 or 20 pages. Developers want good
 default behavior first then specific customization after.

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


More information about the wp-trac mailing list