Upload Field to YouTube for ACF is a WordPress plugin that allows you to upload videos directly to YouTube via API from the WordPress admin area and/or select existing videos on your YouTube channel based on playlists. It is particularly useful for managing videos that may be associated with Custom Post Types (CPT).
To use this plugin, you need to configure Google oAuth credentials so the plugin can authenticate with the user's YouTube channel.
- PHP ^8.0
- WordPress ^5.7 || ^6.0
- Advanced Custom Fields ^5.9 || ^6.0
- direct video upload to YouTube from CPTs within the WordPress interface
- selection of existing YouTube videos, filtered by playlists
- support for "unlisted" video privacy, making this plugin ideal for managing private or exclusive videos tied to specific content
- use official ACF Example Field Type
- support for logging with Wonolog ^2.x, if available
- made with Vanilla JS (no jQuery)
- autoload classes with Composer and PSR-4
- support ACF nested repeater
- translations managed via Crowdin
You can install the plugin in three ways: manually, via Composer (wpackagist) (coming soon) or via Composer (package).
Manual Installation
- Go to the Releases section of this repository.
- Download the latest release zip file.
- Log in to your WordPress admin dashboard.
- Navigate to
Plugins
>Add New
. - Click
Upload Plugin
. - Choose the downloaded zip file and click
Install Now
.
Installation via Composer "wpackagist" (coming soon)
If you use Composer to manage WordPress plugins, you can install it from WordPress Packagist:
- Open your terminal.
- Navigate to the root directory of your WordPress installation.
- Ensure your
composer.json
file has the following configuration: *
{
"require": {
"composer/installers": "^1.0 || ^2.0",
"wpackagist-plugin/upload-field-to-youtube-for-acf": "^0.1"
},
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
- Run the following command:
composer update
Note:
* composer/installers
might already be required by another dependency.
Installation via Composer "package"
If you use Composer to manage WordPress plugins, you can install it from this repository directly:
- Open your terminal.
- Navigate to the root directory of your WordPress installation.
- Ensure your
composer.json
file has the following configuration: *
{
"require": {
"composer/installers": "^1.0 || ^2.0",
"frugan-dev/upload-field-to-youtube-for-acf": "^0.1"
},
"repositories": [
{
"type": "package",
"package": {
"name": "frugan-dev/upload-field-to-youtube-for-acf",
"version": "0.1.0",
"type": "wordpress-plugin",
"dist": {
"url": "https://github.com/frugan-dev/upload-field-to-youtube-for-acf/releases/download/v0.1.0/upload-field-to-youtube-for-acf.zip",
"type": "zip"
}
}
}
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
- Run the following command:
composer update
Note:
* composer/installers
might already be required by another dependency.
Once installed:
- In your WordPress admin dashboard, navigate to the
Plugins
section and clickActivate Plugin
. - Create a new field via ACF and select the
YouTube Uploader
type. - Read the description above for advanced usage instructions.
- Go to the Google API Console.
- Create a project or select an existing one.
- Navigate to the OAuth consent screen section and configure the required details to enable authentication.
- Then, go to Credentials and create an OAuth 2.0 Client ID.
- In the Authorized redirect URIs field, enter your WordPress site's callback URL (e.g.,
https://domain.tld/wp-admin/
). - Obtain the
Client ID
andClient Secret
.
If you use the API upload mode, please note this important notice here:
All videos uploaded via the
videos.insert
endpoint from unverified API projects created after July 28, 2020, will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the YouTube Terms of Service.
Add the following lines to wp-config.php
to define the oAuth credentials:
define('FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_ID', 'Client ID');
define('FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_SECRET', 'Client Secret');
If you use filename-based cache busting, the plugin supports the following definition in wp-config.php
:
define('FRUGAN_UFTYFACF_CACHE_BUSTING_ENABLED', true);
For more information, see filename-based cache busting on Nginx and Apache.
See LINKS file.
See auto-CHANGELOG file.
For your contributions please use: