Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

Why isn't this youtube shortcode working?

I think this is what you are looking for: <?php echo wp_oembed_get('https://www.youtube.com/watch?v=vZBCTc9zHtI'); ?> For more details check this documentation.
Rituparna sonowal's user avatar
3 votes
Accepted

How to change thumbnail of embedded Youtube video?

The [video] shortcode can be used with the src being an URL of a youtube video. To set a placeholder, preview thumbnail use poster, it even works nicely via GUI. In the end it should look somewhat ...
Nicolai Grossherr's user avatar
3 votes
Accepted

Wordpress block editor embeds not working in theme (single.php)

That would be because they're using oEmbed, not a shortcode. You should use the function the_content() to render the content of a post, as it applies all the things required to make embeds, shortcodes,...
cameronjonesweb's user avatar
3 votes

Preventing YouTube embeds loading multiple instances of player JS?

In theory youtube embedding is done as iframes, and iframe are virtual additional independent web pages which are rendered at the same window, therefor the content of one iframe can not gave an impact ...
Mark Kaplun's user avatar
  • 23.4k
3 votes

WordPress, oEmbed & YouTube video's with a 'dash'

Turns out the YouTube video in question had Embedding disabled by request. Tested with other YouTube videos with a 'dash' and they work fine (if embedding is not disabled).
David Clough's user avatar
2 votes

WordPress Editor not getting youtube video preview

Had this same issue, but figured it out once I dug around in WordPress a bit. What you need to do to make this work in a frontend tinyMCE editor is make sure you enqueue this JS file: add_action( '...
mauteri's user avatar
  • 121
2 votes

Why isn't this youtube shortcode working?

If you just want to embed a video in the content area, WordPress does this pretty elegantly with oembeds. You just need to paste the URL into the editor and save the post. As long as the embeds are ...
Dave Romsey's user avatar
  • 17.7k
2 votes

Remove Title of youtube video

This works, the OP code was odd and I've never seen that usage before or the other filter. Tested and works. This code removes Title on youtube but doesn't touch anything else since the parameters ...
Christina's user avatar
  • 463
2 votes

YouTube embed parameters?

There's always a filter you can use to hook into the output, see embed_oembed_html. Try this in a custom plugin or child theme's functions file, it will add any other query strings to the iframe src ...
Ismail's user avatar
  • 1,936
2 votes

How to make an embeded a Youtube video from custom field text responsive to screen size?

Welcome to WordPress StackExchange. This is really an HTML/CSS question rather than a WordPress specific one, so you will have better luck getting a quick answer in the future by posting to another ...
tmdesigned's user avatar
  • 1,655
2 votes

Youtube - Embed as IFRAME

If you don't want to utilize the latest oembed functions and want the old iframe way from any page or post, you can do these: Get the embed code from any youtube video. While editing/creating your ...
Carl Alberto's user avatar
  • 1,077
2 votes
Accepted

WordPress 5.3.x YouTube oEmbed is not working

So apparently the issue also happens in WordPress 5.6 (the latest release as of writing), and YouTube is probably at fault because the (oEmbed) <link> tags are in the body instead of the head (...
Sally CJ's user avatar
  • 39.3k
1 vote
Accepted

Avoid embedding YouTube videos and open them in a new window

Simple Shortcode: function alternative_youtube_embed_func( $atts ) { $a = shortcode_atts( array( 'id' => 'ScMzIvxBSi4' // youtube video ID from video URL ), $atts); return '<...
user232080's user avatar
1 vote

Avoid embedding YouTube videos and open them in a new window

I am trying to do the exact same as you. I installed a plugin, think it's called lazy load. It made a nice, local thumbnail for my YT video in my WP post. Then I installed a plugin, that opens ...
Morten's user avatar
  • 11
1 vote
Accepted

I'm having a problem viewing the Youtube video

You should use the_content function to process embeds. Another way is to apply the_content filter. apply_filters( 'the_content', $post->post_content' );
Anton Lukin's user avatar
1 vote

YouTube embeded video will not resize (only full screen responsive)

There is a check box in the Headway backend. Unticked it - and it worked. Embedded youtube video will now resize with iframe size code. Thanks Dave Romsey
user122739's user avatar
1 vote
Accepted

YouTube API 403 error when website restriction set

If you restrict the application (or API key) by HTTP referrers, then your remote HTTP request should include a valid HTTP_REFERER header, which wp_remote_get() does not set by default. And you can set ...
Sally CJ's user avatar
  • 39.3k
1 vote
Accepted

Modify YouTube Embed Code to fit theme

If you're using the block editor, the fix is simple: add_theme_support( 'responsive-embeds' ); You can also make the iframe responsive using pure CSS, just wrap it in a div: <div class="yt-...
Tom J Nowell's user avatar
  • 59.5k
1 vote
Accepted

Embed youtube list with sidemenu opened

This isn't possible, youtube doesn't provide an embed with an open playlist. If it did, this isn't something that could be resolved from the WordPress end, as it's a Youtube OEmbed issue. You will ...
Tom J Nowell's user avatar
  • 59.5k
1 vote

Getting youtube links from post_content not working

Ok here is working code: function get_yts() { $query_args = array( 's' => 'youtube.com/watch?v=', ); $posts = get_posts( $query_args ); foreach ($posts as $p) { $input_line = $p-&...
FrancMo's user avatar
  • 153
1 vote
Accepted

How to edit embed filter for youtube video to allow responsive full width layout

Thanks to Serkan's suggestion I was pointed in the right direction to search for editing the wrapper rather than filtering the video itself (even though I would have loved a "filter only" solution.) ...
Mr.Brown's user avatar
  • 1,025
1 vote

Wordpress site in China times out on requests to youtube

The Youtube is called by a script named "jquery.st.youtube.js" which is located in your themes folder. You seem to use a premium theme named "Wunder" which effectively means you can do one of two ...
HU is Sebastian's user avatar
1 vote

Embed Youtube video link in wordpress editor

Try just pasting the YouTube URL in to the post or page in the text editor with-out embed code as an editor. See if that works never heard anyone having this problem... https://www.youtube.com/watch?...
chop62's user avatar
  • 181
1 vote

Preventing YouTube embeds loading multiple instances of player JS?

Google I/O 2011: YouTube's iframe Player: The Future of Embedding will tell you all about the past's future. You might be able to find an alternative on to iFrame on the YouTube Developer section but ...
jgraup's user avatar
  • 9,754
1 vote
Accepted

Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?

By default get_post_meta returns an array. If you wish to return a single value you need to set the 3rd parameter to true. Eg. get_post_meta(93, 'youtubeId', true); And did you know that your ...
ngearing's user avatar
  • 2,144
1 vote

Why isn't this youtube shortcode working?

do_shortcode() Is used to printout shortcode. And you are writting URL in it. No use of this. Try to implement wp_oembed_get( $url, $args ) This will work for you. So your code will wp_oembed_get(...
gsjha's user avatar
  • 53
1 vote

Iframes inside bootstrap tab disappear when tab is shown

Your problem is not within your control. iframes are not your site (at least when embedding content from outside sources). The content there is under the control of some other developer. Then you have ...
kaiser's user avatar
  • 50.6k
1 vote

Cannot embed YouTube videos "Failed to embed" error

This may be due to a failed network request from the server to youtube. If the server cannot reach YouTube, the embed will show as "failed to embed" in the editor. You can fix the problem by ...
here's user avatar
  • 326

Only top scored, non community-wiki answers of a minimum length are eligible