=== Youtube Video Search === Contributors: mauriya Donate link: https://www.paypal.me/ryanmahato Tags: youtube, video search, gutenberg block, video gallery, creator tools Requires at least: 6.4 Tested up to: 7.0 Requires PHP: 8.0 Stable tag: 3.2.3 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html A searchable YouTube video wall for your site. Prioritize your own channel, place it via block or widget, with SEO-ready video markup built in. == Description == **Live Demo →** https://www.youtube.com/watch?v=qISHmLKOdNE **Youtube Video Search turns any page on your site into a live YouTube search engine** — with your own channel's videos front and center. Type a keyword, get real thumbnails, view counts, and a click-to-play embedded player that queues up the rest of the results as a playlist. No page reload, no leaving your site. It was built with one audience in mind: **YouTube creators, video bloggers, course/membership sites, and media or review sites** who want visitors to discover their video content without bouncing over to youtube.com — and without a dozen manually-embedded iframes to maintain. = Why creators use it = * **Your channel comes first.** Add your channel(s) once. Every search checks your channel for matches before anyone sees a public result — or restrict search to your channel only, with one checkbox. Either way, your content is what visitors find. * **Drop it in anywhere, no code required.** A Gutenberg block, a classic widget, a shortcode, or a template tag — pick whichever fits how you build. All four are the exact same search box under the hood, so behavior never differs between them. * **It actually helps your SEO**, not just your visitors. Your latest uploads are rendered as real, crawlable links directly in the page's HTML on page load — not hidden behind a search box that only JavaScript can fill in. Every video listing carries schema.org VideoObject structured data (the same markup Google uses for video rich results), and a machine-readable JSON feed of your channel is available for your own tools or AI integrations. * **Modern, mobile-first design.** A responsive card grid, automatic dark mode, and a fluid video player that looks right from a phone to a widescreen monitor — no theme-specific CSS fighting required. * **Your API key never leaves your server.** Every YouTube Data API request is proxied through your own site; visitors' browsers never see your key, unlike plugins that print it straight into page JavaScript. = Features = * Gutenberg block — search, insert, done. Live preview in the editor. * Classic widget for any sidebar/footer widget area. * `[youtubesearch]` shortcode with optional heading/placeholder attributes. * `ytps_render_search()` template tag for theme developers. * Multiple instances on one page (e.g. widget + block together) work independently, out of the box. * Configure one or more of your own channels; matched videos are shown first, or exclusively, your choice. * Server-rendered, crawlable "latest videos" grid + schema.org JSON-LD for SEO — no JavaScript required for search engines to see real content. * A cached JSON REST feed of your channel's videos (`/wp-json/ytps/v1/videos`) for your own tooling or AI agents. * Real-time search suggestions, debounced search-as-you-type, keyboard accessible. * Modern, mobile-responsive card grid with automatic dark mode. * Works with or without an API key configured (shows a friendly notice to visitors instead of breaking). * No third-party CDN dependencies (no Bootstrap, no external jQuery) — uses WordPress core's own bundled scripts. = Requirements = * WordPress 6.4+ * PHP 8.0+ * A free YouTube Data API v3 key from Google Cloud Console (the plugin installs and displays fine without one; search itself needs a key) == Installation == = Quick start = 1. Upload the plugin to `/wp-content/plugins/`, or install it through the Plugins screen in your dashboard. 2. Activate the plugin. 3. Go to **Settings → Youtube API Setting**. 4. Enter a YouTube Data API v3 key. Don't have one? Click the "Get a free API key" link on that page — it takes about two minutes in Google Cloud Console (enable the "YouTube Data API v3", then create an API key under Credentials). 5. (Recommended for creators) Enter your channel — a `@handle`, a full channel URL, or a channel name — and choose whether your channel's videos should be shown first alongside public results, or exclusively. 6. Place the search box using whichever method fits your workflow: * **Block editor:** click **+**, search "YouTube Video Search", insert. * **Widget:** **Appearance → Widgets**, add "YouTube Video Search" to any widget area. * **Shortcode:** paste `[youtubesearch]` into any post, page, or text widget. * **Theme file:** add `` to a template. Full copy-paste snippets and SEO tips are also available right on the Settings → Youtube API Setting screen after activation, under "How to Use This Plugin." = Getting an API key (step by step) = 1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials). 2. Create a project (or select an existing one). 3. Go to **APIs & Services → Library**, search for "YouTube Data API v3", and click **Enable**. 4. Go to **APIs & Services → Credentials**, click **Create Credentials → API key**. 5. Copy the key and paste it into Settings → Youtube API Setting on your site. The free tier covers most small-to-medium sites comfortably; the plugin batches API calls (search + statistics in as few requests as possible, cached where it makes sense) to keep quota use efficient. == Growing your channel with this plugin == A few ways creators get the most out of a searchable video wall: * **Give it a real page.** Create a "Videos" or "Watch" page, add the block, link to it from your main navigation. That's a page search engines can actually index and rank — a bare embed on your homepage isn't. * **Prioritize your channel, don't restrict it (usually).** Leaving "Channel Restriction" unchecked means a visitor searching a topic in your niche sees your videos first, with relevant public results as a fallback — better for discovery than an empty result set when your channel hasn't covered that exact keyword yet. * **Use headings.** Every placement method accepts an optional heading ("Watch Our Tutorials," "Search Our Recipes," etc.) — it renders as a real on-page `