How to Embed a YouTube Subscribe Button on Your Website in 2026

The classic g-ytsubscribe widget is unreliable in 2026 thanks to ad blockers and third-party cookie blocking. Here's the sub_confirmation=1 link that actually works, plus how to find your channel ID.

YouTube Subscribe Button: 2026 Guide, working embed code, no dead widgets

Google’s official YouTube Subscribe Button, the little box you drop onto a page with a g-ytsubscribe div and a script tag, is still technically served by Google. It’s also, in practice, one of the least reliable widgets you can add to a site. Ad blockers routinely strip it out, browsers that block third-party cookies (Safari, Firefox, and increasingly Chrome) stop it working properly, and it traces back to plumbing built for the old Google+ integrations that were switched off in March 2019.

This guide covers what actually works in 2026: a plain link that doesn’t depend on any of that, how to find your channel ID when you need it, and, if you still want the official widget as a decorative extra, the code for that too.

Quick Facts

  • The classic g-ytsubscribe widget is built on the old Google+ platform library and is commonly blocked by ad blockers and privacy-focused browsers, so it often just doesn’t render.
  • The reliable option is a plain link ending in ?sub_confirmation=1. No JavaScript, nothing for a blocker to strip.
  • It works with any channel URL format: /channel/UC..., /@handle, or the older /c/ and /user/ paths.
  • Find your Channel ID in YouTube Studio under Settings > Channel > Advanced settings.
  • If a visitor is already signed into YouTube, the link takes them straight to a one-click subscribe confirmation. If not, they’re asked to sign in first.

Why the old subscribe button widget is so unreliable

The g-ytsubscribe embed loads apis.google.com/js/platform.js and renders an iframe that needs to read your visitor’s Google sign-in state across domains, exactly the kind of third-party, cross-site behaviour that modern browsers and ad blockers are built to stop. Safari’s Intelligent Tracking Prevention, Firefox’s Enhanced Tracking Protection, and most ad blocker filter lists (EasyList in particular) flag scripts loaded from that path.

The result: the box either fails to render at all, or renders but the click does nothing, and you get no error message either way. It’s not a bug you can fix on your end. It’s the widget running into infrastructure that was already retired for other purposes.

The simplest fix: a plain subscribe link

YouTube supports a query parameter, sub_confirmation=1, that you can append to any channel URL. Click it while signed in and YouTube shows a one-click confirmation to subscribe, no widget, no third-party script, nothing to block.

https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw?sub_confirmation=1

https://www.youtube.com/@yourhandle?sub_confirmation=1

Both formats work. If your channel still uses a /c/ custom URL or a /user/ legacy username, the same parameter works there too. This is just a normal link, so it works exactly the same whether you paste it into a WordPress paragraph, a menu item, or a call-to-action button block.

Finding your channel ID

You often don’t need it, your @handle works directly in the link above, but the canonical UC... ID is worth having for anything that specifically asks for a channel ID rather than a handle (some embed tools and analytics platforms still do).

  1. For your own channel: sign into YouTube Studio, go to Settings (bottom left), then Channel > Advanced settings. Your Channel ID is shown there with a copy button.
  2. For any channel, including someone else’s: open the channel page, view the page source (Ctrl+U or Cmd+U), and search for "channelId" or "externalId". The value next to it is the UC... ID.

Turning the link into a styled button

In WordPress, drop a Custom HTML block and wrap the link in a bit of markup you can style with your theme’s button classes, or reuse the site’s existing button CSS:

<a href="https://www.youtube.com/@yourhandle?sub_confirmation=1"
   target="_blank" rel="noopener"
   style="display:inline-block;padding:10px 18px;background:#FF0000;color:#fff;
   border-radius:6px;text-decoration:none;font-weight:600;">
  Subscribe on YouTube
</a>

That’s it. No script to load, so it doesn’t slow the page down and it renders identically for every visitor regardless of blockers.

If you still want Google’s official widget

It’s still documented and technically still works for visitors who don’t block it, so there’s no harm running it as a decorative extra alongside a plain link, just don’t rely on it as your only option:

<div class="g-ytsubscribe" data-channelid="UC_x5XG1OV2P6uZZ5FSM9Ttw"
     data-layout="full" data-count="default"></div>
<script src="https://apis.google.com/js/platform.js"></script>

data-layout accepts default or full (adds the channel avatar and name), and data-count accepts default or hidden. Expect a meaningful chunk of visitors to see nothing at all.

Frequently asked questions

Do I need my channel ID, or is the handle enough?

The handle is enough. youtube.com/@yourhandle?sub_confirmation=1 works exactly the same as the /channel/UC... version. Only use the ID if a specific tool asks for it by name.

Will the subscribe link slow my page down?

No. It’s a plain anchor tag with no script attached, so it has zero effect on page load or Core Web Vitals.

Can I show a live subscriber count next to the link?

Not with a plain link, that needs the YouTube Data API and a bit of server-side code to keep it updated without hitting rate limits. For most blogs it’s not worth the maintenance for a number that changes slowly.

What happened to the old Google+ subscribe embed exactly?

Google shut down Google+ web integrations (plugins, interactive posts, and related sharing features) in March 2019. The subscribe button’s underlying script survived that cut, but it still depends on the same kind of cross-site, third-party behaviour that browsers and blockers have since clamped down on, which is why it’s become so unreliable rather than being formally retired.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.

Leave a Reply

Your email address will not be published. Required fields are marked *