Do you want to showcase your YouTube videos directly on your WordPress site — but don’t know how to connect your plugin to YouTube? This guide will walk you through the exact steps to create and add a YouTube API key. I am using WP Social Ninja Pro for this example. One can also use other similar plugins.
🧰 How to Create a YouTube Data API Key (Step-by-Step)
📝 Prerequisites:
- A Google account
- Optional: Access to a Google Cloud billing account (not always required for basic use)
Why You Need a YouTube API Key
Most WordPress plugins can’t access your YouTube content unless you provide a special key from Google called an API key. This key lets the plugin communicate with YouTube’s servers to fetch your videos, playlists, and channel data — safely and reliably.
✅ Step 1: Go to the Google Cloud Console
URL: https://console.cloud.google.com/
- Log in with your Google account.
- If prompted, agree to the terms of service.
✅ Step 2: Create a New Google Cloud Project
- Click the Select a project (New project?) in the top menu bar.
- Select “New Project.”
- Name your project (e.g.
YouTube Feed for WordPress
) - Click Create
✅ Step 3: Enable the YouTube Data API v3
- Once your project is selected, go to under Quick access:
APIs & Services → Library - Search for or scroll to you find “YouTube Data API v3”
- Click it, then click Enable
- Select the project.

✅ Step 4: Create an API Key
- Go to: APIs & Services → Credentials
- Click “+ Create Credentials” → choose API key
- A new key will appear in a popup (copy it!)
- Optional: Click “Restrict key” to limit usage (recommended for security)
✅ Step 5: Add the API Key to WP Social Ninja Pro
- In your WordPress dashboard, go to WP Social Ninja → Feeds → YouTube
- Paste your API key into the required field
- Save settings
✅ Step 6: Customize and Embed the YouTube Feed
- Configure your layout, number of videos, channel ID, etc.
- Add the shortcode or block to your page or post
🔒 Optional: Restrict Your API Key (Recommended)
To prevent misuse:
- In the Credentials screen, click the name of your API key
- Under “Application restrictions,” select
HTTP referrers (web sites)
- Add your domain (e.g.,
https://yourdomain.com/*
) - Save
I also made a walk through of how to add Instagram to WP Social Ninja.
Resources used.
ChatGPT.