WordPress is an awesome platform for creating powerful websites. Here's a quick guide to making Wistia and WordPress go together like PB&J.
Like Wistia's favorite treat (donuts 🍩), WordPress comes in many flavors. Because of this, how you embed your video varies based on what type of WordPress environment you're using. Is it WordPress.com or WordPress.org? Are you using special plugins? What about your theme?
There are so many ways to customize WordPress, that one size does not fit all. It can be a pretty variable experience, but this page is here to help.
Embedding on Wordpress.com
Let's start with WordPress.com. Adding video to your posts is super easy, since Wistia is a default oEmbed provider for WordPress. So let's dive into grabbing that oEmbed URL and sharing your fantastic video.
Using an oEmbed URL
An oEmbed URL is a simple link that tells WordPress how to embed content from third-party sources (like that cool video hosting platform for businesses you're so fond of).
To create an oEmbed URL for a video in your Wistia account, select "Use oEmbed URL" under Options on the Embed & Share screen. Take a look-see:
That'll give you an oEmbed URL like this example:
If you copy and paste that URL into a WordPress post, WordPress will convert the oEmbed URL into an embedded video. It's.
WordPress.com will sometimes inject the Wistia video thumbnail into your post when you're in editing mode. You can always switch from Visual editing to HTML for easier viewing.
If you're curious about the technical details behind oEmbed's sneaky magic, check out oEmbed.com.
Wistia doesn't currently offer an opportunity to select the "oEmbed" options from the Popover Embed tab. But that doesn't mean it isn't possible. Time to join our secret club!
Creating a popover oEmbed is as easy as adding the
popover=true string to your
So this Standard oEmbed:
It's as easy as that!
If you want to specify the size of the popover thumbnail (when playing, a popover
video will always be responsive in its lightbox), change the
Embedding on WordPress.org
If you're embedding on your WordPress.org site, you'll want to use the Standard (or popover) Wistia embed. Just paste your Standard embed code into your post, and you're good to go!
Since WordPress is highly customizable, these options don't always work in every situation. We recommend using the Standard, Fallback, or regular popover embed code types first, but if those don't work, you'll need to call for backup. That's where the Wistia WordPress plugin comes in handy.
The Wistia WordPress Plugin
If you're having trouble using Standard embeds with your WordPress theme, the Wistia WordPress plugin adds support for Wistia oEmbed URLs. For more information about how that works, see this guide from the WordPress documentation: Embeds in WordPress.
With the Wistia WordPress plugin, you'll be able to quickly add oEmbed URLs to your WordPress.org site.
The Wistia WordPress plugin also includes the Anti-Mangler, which (as the name implies) protects Wistia embed codes on your website from getting mangled by WordPress. It's disabled by default, and should only be enabled if you really don't want to use the oEmbed approach, which is the approach we strongly recommend. The Anti-Mangler is a decent fallback option though, so if you'd like to enable it, head to Settings in your WordPress admin panel, and choose Wistia WordPress. Or on the Plugins page, there's a Settings link right under the plugin name.
The Anti-Mangler used to be enabled by default, but is optional (and no longer recommended) as of version 0.8 of the Wistia WordPress plugin.
Adding Wistia to the oEmbed provider whitelist in your Wordpress
Unfortunately, Wistia is not included in the whitelist for oEmbed providers in all WordPress installations. Fortunately, adding Wistia as a trusted provider isn't too difficult thanks to WordPress being prepared for this sort of situation.
To start, you'll want to use the
wp_oembed_add_provider() function, based on WordPress's own documentation on it. Given the instructions listed in that docuementation in conjunction with the information in our own oEmbed help page this will look like this:
Once you've added that to the functions.php file in your WordPress install, as their documentation indicates, you should be all set to use Wistia media URLs to embed Wistia videos in your WordPress.
Tips for Using WordPress
oEmbed URL not converting into an embedded video?
When inserting an oEmbed URL, make sure you are in HTML editing mode, and leave a line open above and below the URL. If you switch from HTML to Visual mode it can add formatting tags around your oEmbed URL, which may cause it to break. Be careful of that!
Video appearing smaller than it should be?
If you have larger resolution videos and they are appearing smaller or squished, access the WordPress admin control panel (Settings -> Media -> Maximum Video Embed Size) and set the max to the largest size of your video ('no limit' setting doesn't work, it must be actual size). Some WordPress themes will also set a maximum width for content embedded with oEmbed. If you want to change that, check out How to Set oEmbed Max Width in WordPress 3.5 with $content_width.
Video not centered?
If you want to center your video inside a
div or column on your website,
and you are using an oEmbed URL to embed your video, please use a second div with the
display: inline-block;, as seen here:
1 2 3 4 5 6 7
Code not converting to video?
If you've tried adding a Standard Wistia embed (or Fallback or popover), and it's not converting to a video, try installing the Wistia WordPress plugin, and switching to an oEmbed URL.
Still no success? Give us a shout. We'll be happy to help.
To expedite your support, let us know what theme you're using (if any), any other plugins you've installed, and where you're pasting the embed code (as a post, into a module in your theme?). This will help us get to the bottom of the issue faster for you!