2022 Developer Survey is open! Take survey.

Questions tagged [oembed]

A protocol for allowing an embedded representation of a URL on third party sites.

Filter by
Sorted by
Tagged with
1 vote
0 answers
18 views

Is there any way to render the WordPress Gutenberg core/embed block in PHP by passing in the URL?

I'm trying to render the block HTML dynamically by injecting it within a core/query block. The injection is working fine using DOMDocument, but I can't find out how to render the embed HTML. I can use ...
3 votes
1 answer
4k views

Add wrapper to only youtube videos via embed_oembed_html filter function

I have a filter working to wrap embed_oembed links in a responsive wrapper. See code. add_filter('embed_oembed_html', 'wrap_embed_with_div', 10, 3); function wrap_embed_with_div($html, $url, $attr) ...
0 votes
1 answer
2k views

class-oembed Error

PHP Fatal error: Cannot redeclare _wp_oembed_get_object() (previously declared in /home/samdonme/public_html/wp-includes/embed.php:112) in /home/samdonme/public_html/wp-includes/class-oembed.php on ...
3 votes
1 answer
2k views

Any way to use a custom Parameter for vimeo embed without using an iframe?

I am trying to get some oembed parameters attached to my Vimeo clips. I tried to get it going using the following two instructions: Passing Parameters to a Vimeo link in a WordPress Custom Field - ...
6 votes
3 answers
12k views

Get first video from the post (both embed and video shortcodes)

The goal is to grab the first video (embed or shortcode) from the post. So we need to check post content if it has embedded videos ( supported by WP ) or [video] shortcodes. Multiple videos and embeds ...
0 votes
0 answers
19 views

Is it possible to embed a wordpress tag page on wordpress?

I'm trying to use the "Embed URL" block to include another WP site's tag page on my WP page. It seems like I'm able to embed individual posts from that site (so the theme supports embedding)...
0 votes
0 answers
10 views

Add class and change src type inside wp_oembed_get

So I don't know how to properly do this and I've already spent like 3+ hours attempting to figure this out, so I'm getting help from the community. What I'm trying to achieve: Add class='optanon-...
5 votes
2 answers
5k views

How add class youtube and type/html to oembed code?

How can i add : class="youtube-player" type="text/html" to iframe like : function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($...
1 vote
1 answer
653 views

What is the correct oembed provider base url for self-hosted wordpress sites

I used to have both PCsteps.gr and Lifesteps.gr on the same server with the same IP. Oembed would work by default, I could embed posts from one site to the other without any problems. However, since ...
2 votes
1 answer
830 views

wp_insert_post iframe missing

In my install, I use one custom page. Here I put one text field and the fck editor. This is for the title and the content. I need to insert this into a page. I use the following code $my_post = ...
0 votes
2 answers
10k views

Advanced Custom Fields oembed only outputs YouTube URL

Having the exact same problem as @Hjalmar on Advanced Custom Fields, but still no fix. Only the URL text displays. Tried the original ACF oembed option: <div class="embed-container"> <?...
3 votes
2 answers
306 views

How to remove the embed_footer?

I'm trying to remove the entire embed_footer from WordPress embedded posts. By adding the following code in the functions.php, I was able to remove the site title and comments icon. But still, the ...
0 votes
0 answers
12 views

Auto embeds don't work for attachment descriptions

I am able to paste a Youtube link into a post and have it auto embed just fine, but if I go to edit a media description, and put the link there, and then view the attachment page for that media, it ...
7 votes
1 answer
503 views

static variable loop not working in Wordpress

I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file. /* - function that hides first video in post content -...
0 votes
0 answers
67 views

Is there a way to find all posts with Youtube video embedded?

Is there a way to search all posts and pages in my WordPress site and find those who have a Youtube video embedded in them? The reason to do that is I want to disable the wp-embed.min.js but before ...
0 votes
1 answer
642 views

Add class to oEmbed video from within post editor?

I'd like to be able to add classes to oembed videos on the fly in the post editor. This way I could have some videos act like images and alignleft or alignright and have text wrap around them, while ...
0 votes
0 answers
17 views

WordPress fails to embed video URL on specific theme

My developer created custom theme for WP, and for some reason Wordpress fails to embed video URL on user-end. Everything is fine with Default WP themes, also video is fine on visual mode, but if I ...
2 votes
0 answers
62 views

oEmbed in wordpress multisite not working

We've multisite on single wordpress installation. For example, Main site - testsite.com/ Sub site - testsite.com/subsite Now when I try to embed a blog from subsite into mainsite or vice verca or post ...
0 votes
0 answers
205 views

How to add srcdoc attribute to YouTube oEmbed in Gutenberg oEmbed Block

First of all, let me mention that I have already looked at the following two similar questions: Is it possible to modify the default YouTube embed attributes string? Filter oembeds tags to modify ...
0 votes
0 answers
18k views

Embed video from streamtape using direct link

Good Afternoon, i want to embed this video in my wordpress https://streamtape.com/v/7qDqGjlQe4UA9MR/Soul_Land_03_VOSTFR.mp4 Embed code <iframe src="https://streamtape.com/e/7qDqGjlQe4UA9MR/...
0 votes
1 answer
59 views

oembed_cache SPAM problem [closed]

I recently found hundreds of posts with post_type oembed_cache while looking into my database. Many of them appear to be spam. I can't for the life of me figure out how there are being injected into ...
2 votes
1 answer
151 views

WordPress 5.3.x YouTube oEmbed is not working

We followed Brian Fegter's answer to display YouTube videos using WordPress' oEmbed feature: // Public video. $video_url = 'https://www.youtube.com/watch?v=1lODe0i7dNw'; require_once(ABSPATH . 'wp-...
8 votes
1 answer
12k views

What are the Oembed Links For?

My copy of WordPress outputs two <link/> tags in the header of (nearly?) every page. They look like this. <link rel="alternate" type="application/json+oembed" href="http://example.com/wp-...
5 votes
1 answer
2k views

YouTube oEmbed and privacy-enhanced mode

When you´re embed a youtube video in an iframe, you can enable the privacy-enhanced mode, so YouTube doesn´t store information about your web page visitors until they play the video. I've tried to ...
2 votes
0 answers
78 views

Post preview and oembed provider issue using polylang plugin with subdomains

[ X ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate. [ X ] The issue still exists against the latest master branch of Polylang and the latest WordPress ...
0 votes
1 answer
1k views

oEmbed Video in Modal

I'm attempting to use jQuery to open up a video in a modal but can't come up with a way to pass the oEmbed video url to the function which opens the modal. In my theme the user adds the video to an ...
0 votes
0 answers
33 views

Facebook embeds fixing with functions.php

I use this code to solve the new Instagram embeds problem on my old Wordpress site: add_filter('oembed_providers', 'fr_replace_deprecated_instagram_api', 10, 1); function ...
0 votes
1 answer
17 views

How to automatically search my entire site for any content embedded using oEmbed?

How can I carry out an automatic search of all pages/posts on my site for any content embedded using oEmbed (preferably Facebook/Instagram content)? The reason I ask is because this WPBeginner post ...
1 vote
1 answer
57 views

How to oEmbed MySite in Wordpress

Could somebody please help me understand how to debug this and what to do? In short I created a oembed provider and added it to wordpress. I see that wordpress got in response the correct json. But ...
1 vote
1 answer
228 views

Styling text and images in the_content()

So I have recently started working on Wordpress and coming from a different programming background, having the logic but not being able to actually code is an issue I have been butting my head on for ...
1 vote
0 answers
19 views

Worrisome oembed hits

I'm getting oembed hits to my wordpress site that look like some kind of hacking attempts. Here's an example: /wp-json/oembed/1.0/embed?url=https%3A%2F%2FMySite.com%2Fprivacy%2F&format=xml&...
1 vote
2 answers
895 views

Instagram URL is converted into oEmbed

I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes. I'm using Gutenberg's Instagram embed blog to add the URL's.https://blog.wwf.sg/ocean/2018/11/netflix-...
1 vote
0 answers
27 views

How can I grab the video id of youtube?

I tried $videoID = wp_oembed_get( get_post_meta( get_the_ID(), 'video_url', true ) ); but that doesn't seem to do anything. I'm trying to set playlist id as the video id so the video loops itself. ...
0 votes
1 answer
471 views

Remove wordpress embed share icon?

I am modifying my embed-content.php. I find the functions here to remove some oembed icons but not the share icon. I do not find a function to remove JUST the share icon on wordpress oembeds. Can ...
0 votes
1 answer
2k views

Removing WordPress Icon from oembed link footer

I am trying to remove the default WordPress icon that displays on oembed links when there is no site icon. Here is a link to the site(3 links at the bottom) https://libsource.com/library-as-a-service/...
0 votes
0 answers
144 views

Cannot display the_content() after removed WordPress 5's auto embed feature (iframe & blockquote)

Novice here, please help. I made a dynamic page with Custom Post Type UI plugin where the user can input news updates. The information to be filled are date, title, and a link (a clickable button that ...
0 votes
1 answer
34 views

Security when outputing wp_oembed_get code

This is a code I have in a function.php action. It is responsible for getting and displaying an embed code. Typically there is a youtube link from $embed_link but it comes from a public form so it can ...
2 votes
2 answers
278 views

Register Embed Handler for Padlet.com

I'm trying and failing to register an embed code for content from padlet.com (strangely it's supported in WP.com but not WP.org). A URL like https://padlet.com/cogdogblog/aos9fosbbwk4 should embed ...
0 votes
1 answer
508 views

How to disable URL preview in Wordpress comments

I disabled URL embed in Wordpress using the following code in functions.php: function my_deregister_scripts(){ wp_dequeue_script( 'wp-embed' ); } add_action( 'wp_footer', 'my_deregister_scripts' ); ...
1 vote
1 answer
298 views

How do I phpunit test a post output process?

I like to know how to test the html output of a post. Like WP would output it on the frontend in reality. My specific case at this point is to test oembed caching as I want to test re-caching. AFAIK ...
5 votes
1 answer
4k views

How can I clear oEmbed caches for YouTube on posts as they are loaded

I have a site with tons of posts hundreds/thousands of which have YouTube videos embedded. Most use the default [embed]youtube_url[embed] format and the actual embed code is stored in the oEmbed ...
1 vote
1 answer
708 views

Applying an oEmbed filter to a custom post type

I have a function in my functions.php file which takes any embedded YouTube URL, appends &rel=0 to the end of the URL, and wraps it in a <div>. It works perfectly for YouTube URLs I paste ...
0 votes
0 answers
2k views

How to modify the HTML output of Gutenberg block? (Youtube)

I'm using a headless Wordpress linked to a Nuxt projet and I like to modify the output of my Gutenblock when it's called from the REST API. Current ouput is : <!-- wp:core-embed/youtube {"url":"...
0 votes
1 answer
239 views

Combine embed_oembed_html and oembed_result

I have two functions that are exactly the same, because they are applied to different filters...is there any way to combine them so I don't have to write them out twice? My code: function ...
0 votes
0 answers
332 views

How to disable oembed cache service?

Today I delete all oembed records by postmeta where meta_key like '_oembed%' after 5 mins, check again the table, magic, the wordpress started to insert _oembed records again (9857 total)... Can ...
1 vote
0 answers
87 views

How to set up front end editor to autoembed media for non-logged in users?

I have a series of themes that allow site visitors to contribute content as posts (they enter as drafts) from a front end editor. I have been using a technique of invisibly logging them in as an ...
0 votes
0 answers
75 views

How do I keep my iframes responsive and scaled to fit their container?

This is a WordPress core question and only a CSS question as a byproduct. I am designing a theme using bootstrap. Everything looks exactly as I want it to with one exception - links embedded from my ...
0 votes
0 answers
48 views

What is the correct way to obtain access to the WP_oEmbed object?

I know that WP_oEmbed is a class used by WordPress to handle oEmbeds. Is this available as a global or should I create a new instance of it? Update: I have found a function called ...
1 vote
1 answer
219 views

Can I use wp_oembed_get to detect a valid embeddable link or is there a better way to do so?

I am looking for an efficient way to detect if user input is a valid embed link (and of what type). I know that one can cause WordPress to run its embed code with arbitrary input. For example, like ...
1 vote
0 answers
104 views

How to register a embed handler as a fallback to a oEmbed handler?

Testing this with the Embed Gutenberg Block. In the backend it actually shows the video so this seems wrong that it behaves differently there. Registering embed handlers causes the to take priority ...