Docs

Must-Have CookieNew

2 min readUpdated November 10, 2026

Must-Have Cookie can block YouTube and Vimeo until a visitor agrees to media cookies. WP LinkCanvas detects it automatically and makes sure a Media player (video or audio) link never sits on a player that cannot start.

This applies to media player links with a YouTube or Vimeo source. Your own video and audio files, HLS streams and Bunny Stream do not use cookies from those sites and play as normal.

Setup#

Nothing to install. When Must-Have Cookie is active, go to Link Bio → Settings → Media player and choose how YouTube and Vimeo players behave, then click Save settings.

Media player settings with Ask before playing, Always allow YouTube and Vimeo, and the Consent buttons field

Ask before playing#

This is the default. When Must-Have Cookie blocks a YouTube or Vimeo player, the visitor sees a short message on the player instead of a video that keeps loading. It shows Must-Have Cookie’s own buttons:

  • Accept and play accepts cookies in Must-Have Cookie, the same as Accept All in its banner.
  • Cookie settings opens Must-Have Cookie’s settings, so the visitor can choose for themselves.

Must-Have Cookie records the consent itself. The video then plays, also when Must-Have Cookie reloads the page to apply the new consent. If the visitor allows media in the Must-Have Cookie banner instead, the players on the page load too.

Changing the buttons#

Under Link Bio → Settings → Media player → Consent buttons, enter any Must-Have Cookie shortcodes. Leave it empty to use the default:


Accept and play 

The buttons are the same for every visitor, so page caches are fine. Developers can change the button HTML with the nlb_player_consent_buttons filter.

Always allow YouTube and Vimeo#

Choose this to skip the consent step. WP LinkCanvas adds these hosts to Must-Have Cookie’s essential hosts:

  • www.youtube.com
  • www.youtube-nocookie.com
  • i.ytimg.com
  • player.vimeo.com
  • i.vimeocdn.com

Videos then play straight away for every visitor. Check that this fits the privacy rules that apply to your visitors before you choose it.

Developers can change the host list with the nlb_player_consent_hosts filter:

add_filter( 'nlb_player_consent_hosts', function ( $hosts ) {
	// Allow YouTube only.
	return array( 'www.youtube.com', 'www.youtube-nocookie.com', 'i.ytimg.com' );
} );

The Media player panel says the setting is only used with Must-Have Cookie, and the choice has no effect. Players load as normal.

If another cookie tool or a browser extension blocks a video, the player shows This video could not be loaded with Try again, rather than spinning.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only