oEmbed not recognising Vimeo URLs

I am trying to embed a Vimeo video into a post. I am inserting the URL into the page like so.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

http//vimeo.com/1234

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

It is outputted as the plain text URL. I have tried it with a youtube link and it worked perfectly. I have also tried wrapping it in the shortcode but that just wrapped it in anchor tags.

Read More

Any suggestions would be much appreciated, thanks.

Related posts

Leave a Reply

1 comment

  1. Looking into WordPress Core vimeo is registered like so:

    '#http://(www.)?vimeo.com/.*#i' => array( 'http://www.vimeo.com/api/oembed.{format}', true  ),
    

    But looking at vimeo API for oEmbed they show their URL without the www. so what you need to do is register vimeo oEmbed correctly:

    add_action( 'init', 'add_vimeo_oembed_correctly' );
    function add_vimeo_oembed_correctly()
    {
        wp_oembed_add_provider(
            '#http://(www.)?vimeo.com/.*#i',
            'http://vimeo.com/api/oembed.{format}',
            true
        );
    }
    

    You can place this in your theme functions file or place in a plugin.

    You may need to revisit posts that have Vimeo embeds and save again after putting this fix in.