Distributing ACF in a plugin / theme


The Advanced Custom Fields plugin is a great tool to power your website, but did you know it can also be included within your premium theme or premium plugin?


  • Rapidly develop your theme using all of the flexibility that ACF provides
  • Rapidly develop your plugin without having to write custom inputs for options
  • Use the UI to create your fields, then export them to JSON or PHP
  • Prevent users from editing or creating fields by enabling ‘lite mode’ to hide the UI interface
  • No need to customize any code, just download the plugin and include it!


Some rules apply to including the Advanced Custom Fields plugin in your theme or plugin. These surround the use of ACF PRO.

Distributing ACF PRO within a theme/plugin

You can include the ACF PRO plugin within a premium theme/plugin as long as it is made clear in the copyright / information that the ACF PRO files are not to be used or distributed outside of the premium theme/plugin.

You can not include the ACF PRO plugin within a free theme/plugin.

You can not include a ACF PRO license key within the theme/plugin/materials.

Distributing ACF within a theme/plugin

You can include the (free) ACF plugin within a free or premium theme/plugin.

Including files

Including ACF or ACF PRO is easy, just follow these steps:

  1. Download a copy of the plugin
  2. Copy the plugin to your theme / plugin
  3. Include the main plugin file
  4. Customize the directory and path settings
  5. Hide the ACF admin pages (optional)

// 1. customize ACF path
add_filter('acf/settings/path', 'my_acf_settings_path');
function my_acf_settings_path( $path ) {
    // update path
    $path = get_stylesheet_directory() . '/acf/';
    // return
    return $path;

// 2. customize ACF dir
add_filter('acf/settings/dir', 'my_acf_settings_dir');
function my_acf_settings_dir( $dir ) {
    // update path
    $dir = get_stylesheet_directory_uri() . '/acf/';
    // return
    return $dir;

// 3. Hide ACF field group menu item
add_filter('acf/settings/show_admin', '__return_false');

// 4. Include ACF
include_once( get_stylesheet_directory() . '/acf/acf.php' );


Including fields

Fields (and field groups) can be included by both PHP and JSON. To include fields via PHP, please use the ACF export tool and copy the generated PHP code into your theme / plugin. To include fields via JSON, please read the following article: https://www.advancedcustomfields.com/resources/features/local-json/