Skip to main content

oEmbed Support

Better Messages auto-embeds rich media when users paste a supported URL into a message — YouTube and Vimeo become inline video players, SoundCloud and Spotify embed audio, and any URL from WordPress's oEmbed provider list renders as a native widget. For regular non-oEmbed URLs, the plugin generates "nice link" preview cards with thumbnail, title, and description, so shared links look like rich attachments instead of bare URLs.

A YouTube link pasted into a chat message rendering as an inline video player inside the conversation thread

What it adds#

  • Auto-embed inline media when a supported URL appears in a message
  • Native players for YouTube, Vimeo, SoundCloud, Spotify, Twitch, Twitter / X, TikTok, Reddit, Imgur, Flickr, and every other WordPress oEmbed provider
  • "Nice link" preview cards (thumbnail + title + description) for regular URLs
  • Media plays inline without leaving the conversation
  • Works in DMs, group chats, and chat rooms — same rendering everywhere

How it works#

When a user submits a message, Better Messages scans the text for URLs. For each URL:

  1. Check oEmbed providers — if the host matches an oEmbed-supporting service (YouTube, Vimeo, etc.), an embed iframe is rendered inline
  2. If not oEmbed, fetch metadata — for regular URLs, the plugin requests the page and parses OpenGraph + Twitter Card metadata to build a "nice link" card
  3. Cache the result — fetched metadata is cached in wp_options for 24 hours, so the same link doesn't re-fetch on every render
  4. Render in the bubble — the embed or card appears below the message text
URL typeRendered as
youtube.com/watch?v=...Inline YouTube player
vimeo.com/12345Inline Vimeo player
soundcloud.com/.../trackInline SoundCloud player
spotify.com/track/...Inline Spotify widget
twitter.com/.../status/...Inline tweet card
tiktok.com/@user/video/...Inline TikTok player
Regular site URLThumbnail + title + description card
URL inside a code blockPlain text (no embed)

When it matters#

Use caseWhy oEmbed helps
Course / LMS discussionInstructor shares a YouTube lecture — students watch inline
Marketing / podcast communityEmbedded SoundCloud / Spotify episode players
Marketplace product helpVendor shares a Vimeo demo of a product
Social network DMsUsers share TikToks / tweets, rendered as native widgets
Support chatKnowledge-base link shows a thumbnail + summary preview

How to enable#

oEmbed expansion runs through the standard WordPress oEmbed system, so it's always on. Better Messages adds the Enable Nice Links toggle on top.

Navigate to WP Admin → Better Messages → Settings → Messaging.

  • Enable Nice Links — Show link preview cards for URLs that aren't backed by an oEmbed provider

Frequently asked questions#

Does the embed contact the original site?#

Yes — the embed iframe is served by the source (YouTube, Vimeo, etc.). Their tracking / cookies apply. For privacy-strict sites, consider the Privacy-friendly oEmbeds setting which shows a static thumbnail until the user clicks play, so the third-party iframe isn't loaded on page load.

Can I block specific oEmbed providers?#

Yes — hook the embed_oembed_html WordPress filter (Better Messages uses standard WP oEmbed under the hood) and return an empty string for hosts you want to suppress.

Possible reasons: the URL is inside a code block, the URL is a redirect that the provider doesn't recognize, or the WordPress oEmbed cache has a stale failure. Clear the post oEmbed cache via WP-CLI (wp post meta delete <id> _oembed_<hash>) or by editing the message to re-trigger.

Are embeds rendered in the mobile app?#

Yes — the mobile app uses a WebView for the messenger surface, so embeds render the same as on the web. Bandwidth-conscious users can disable embeds in the global settings.

Does this work in email notifications?#

Email notifications include the link as a clickable URL, not as an embedded player (email clients don't support inline video). Nice-link previews appear as a thumbnail + title in the email.

See also#