WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] sharing video on facebook from wordpress (5 posts)

  1. gep13
    Member
    Posted 11 months ago #

    Hello,

    Is there a way to make the embedding of Youtube videos include the necessary meta data tags to ensure that when sharing with, for instance, Facebook, that Facebook is able to scrape the post, and include the YouTub e video as a small thumbnail directly in the Facebook post?

    This is detailed here:

    http://wordpress.stackexchange.com/questions/4153/sharing-video-on-facebook-from-wordpress

    Thanks

    Gary

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    The Stackexchange post you linked to includes an answer that should help you:
    http://wordpress.stackexchange.com/a/4470/27574

    You could include that code in a small plugin.

    Jetpack itself doesn't look for videos in the posts, but I took note of the suggestion. We'll consider adding the option in a future Jetpack release.

  3. gep13
    Member
    Posted 11 months ago #

    Hey,

    That is great news, I think it would be a very useful addition.

    In terms of the suggestion for using a plugin, how would that "look". Never actually created my own plugin. Are you saying that I could create a plugin that is "activated" for each post, and then within each post, look to see if there is an embedded YouTube link. If that link is found, then add the addition meta tags to the page, so that Facebook can pick them up?

    Any tips on where I could get started creating this?

    Thanks

    Gary

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    I haven't actually tested the code in the Stackexchange post, but to transform that code into a plugin you can follow the instructions here:
    https://codex.wordpress.org/Writing_a_Plugin

    You will basically need to copy the code from Stackexchange into a new PHP file, and add a file header to that file to give a name to your plugin. Once it's done you can just drop the plugin to your plugins folder.

  5. gep13
    Member
    Posted 11 months ago #

    Perfect, thanks for the info!

    Gary

Reply

You must log in to post.

About this Plugin

About this Topic