Restricting YouTube API access
I've tried restricting my YouTube API access to just my domain, but then I cannot access videos with WPSN.
Is there an intermediary domain being used that I need to give access to as well?
WP Social Ninja does not use any intermediary or third-party domain to fetch YouTube data.
All YouTube API requests are made server-side from your own WordPress hosting, not from the browser.
Because of this, HTTP referrer (domain) restrictions will block the API requests, which is why the YouTube feed stops working when you restrict the key to your domain.
What we recommend
Please restrict your YouTube API key using IP address restrictions instead:
- Go to Google Cloud Console β Credentials
- Open your YouTube Data API key
- Under Application restrictions, select IP addresses
- Add your serverβs public IP address
- Save the changes
This setup is fully compatible with WP Social Ninja and keeps your API key secure.
Utpol DebnathΒ brilliant - thank you!