Youtube issues after update

AI-generated summary

Users report issues with YouTube embedding after a site update, particularly with youtu.be links and /shorts videos not generating oneboxes. Carleas found that disabling the “Block onebox on redirect” setting resolved youtu.be issues but not /shorts links. Patrickemin confirmed the fix worked except for shorts. Nat investigated and ruled out recent code changes, noting that SiteSetting.block_onebox_on_redirect is false by default and that Google’s deprecation of URL shorteners might be related. Shauny confirmed /shorts don’t embed on their site, but some shorts do work on others. Nat asked for an example, and Carleas observed that embedded shorts often show a preview image, while non-embedded ones do not. NateDhaliwal clarified that the preview is in Markdown mode, not WYSIWYG.

I updated my site today (from_version: c6782e8434f404f30de8cba054dfeac004663981), and since then have been having issues with youtube embedding.

The first issue I noticed is that youtu.be links weren’t generating a onebox, while youtube.com links still worked. After playing around for a bit, I disabled the “Block onebox on redirect” setting, which fixed the issue for youtu.be links, although I need to rebuilt HTML on old posts.

And /shorts/ links still aren’t working, even if I rebuild the HTML.

No errors in logs, nothing else I’ve noticed broken.

Not sure if it’s related, but in trying to troubleshoot I also noticed that trying to disable the ‘Lazy videos’ plugin gives an error: “An error occurred: You are not allowed to change hidden settings: lazy_videos_enabled”

Any ideas?

Thank you so much ! Your solution worked ! (appart for shorts…)

Thanks for the report — we’ll have a look.

I don’t think there’s anything to do here on our end.

All sites have SiteSetting.block_onebox_on_redirect false by default. Meta does so too, so most sites that don’t touch this setting would have youtu.be and /shorts resolving as per normal.

I was concerned that either of these changes

caused the issue, but I can confirm it did not.

I did see this blog post which seems to be very timely - Google URL Shortener links will no longer be available [updated] - Google Developers Blog

Any developers using links built with the Google URL Shortener in the form https://goo.gl/* will be impacted, and these URLs will no longer return a response after August 25th, 2025. We recommend transitioning these links to another URL shortener provider.

While it mentions only goo.gl, I am not surprised if under the hood youtube links have also been made to undergo some sort of redirection moving forwards.

For posterity, here is a youtu.be and a /shorts link rendering fine

YouTube Shorts don’t embed on our site either, is there a setting I need to adjust to make it work?

Do you have an example SFW short you can paste here? If private, feel free to PM me.

Here’s one for example

Ah it works here. Doesn’t work on my site https://forum.tardis.guide

Link where someone posted it but it didn’t work:

(I’ve also tried posting it myself)

Do you have non-default values onebox settings? e.g. on /admin/site_settings/category/all_results?filter=onebox

I don’t have any non-default onebox settings:

It looks like some shorts work on my site, but not all. For example, @nat’s ‘The Twins’ short gets embedded properly, but @Shauny’s does not.

And, not sure if this is relevant, but another difference I noticed between them is that Natalie’s shows a picture in the WYSIWYG preview and Shaun’s does not:

That seems to be consistent for other shorts that do and don’t embed properly on my site.
Shaun, can you replicate?

More accurately, that’s actually the composer preview (you’re in Markdown mode, not WYSIWYG).