Skip to content

Control Jetpack content distribution

By default, Jetpack is enabled on all WordPress sites hosted on the VIP Platform. Jetpack adds a suite of powerful security, performance, and marketing features. Jetpack features that aid in content consumption, distribution, and syndication are collectively referred to as “content distribution tools“.

Jetpack’s content distribution tools provide:

Jetpack’s content distribution tools can be selectively enabled or disabled by defining the VIP_JETPACK_IS_PRIVATE constant as false or true for an environment—or for a limited set of network sites on a WordPress multisite.

For sites that require more customization for access to their content, individual Jetpack content distribution features can be enabled or disabled via code with the jetpack_get_available_modules filter.

Additional Jetpack modules—such as Enhanced Distribution—can also be enabled in the WordPress Admin dashboard.

Enable content distribution

When VIP_JETPACK_IS_PRIVATE is defined as false Jetpack’s content distribution tools are enabled.

When Jetpack’s content distribution tools are enabled for a site or environment—even a non-production environment—content is:

  • Accessible via the WordPress.com REST API or Jetpack Search via unauthenticated requests.
  • Consumable via the WordPress.com Reader.

By default VIP_JETPACK_IS_PRIVATE is defined as false for:

  • Jetpack site connections on production environments. For WordPress multisite, this includes Jetpack connections for network sites on a production environment.
  • Sites that have Jetpack Search enabled, including non-production sites. By default, Jetpack’s content distribution tools are disabled for non-production sites, but enabling Jetpack Search for a site will override that default setting.

Code-enabling content distribution

For environments that have Jetpack’s content distribution tools disabled by default, content distribution can be enabled by defining VIP_JETPACK_IS_PRIVATE as false to override the default setting.

Enable content distribution for all sites on an environment by defining VIP_JETPACK_IS_PRIVATE as false in vip-config.php:

/vip-config/vip-config.php
if ( ! defined( 'VIP_JETPACK_IS_PRIVATE' ) ) {
	define( 'VIP_JETPACK_IS_PRIVATE', false );
}

After the updated code is deployed, the default content distribution features that are included with Jetpack will be restored within 30 minutes.

For sites that require more customization for restricted access to their content, specific Jetpack content distribution features can be selectively enabled or disabled with the jetpack_get_available_modules filter.

Disable content distribution

When VIP_JETPACK_IS_PRIVATE is defined as true Jetpack’s content distribution tools are disabled.

When Jetpack’s content distribution tools are disabled:

  • Content is inaccessible via the WordPress.com REST API by unauthenticated requests.
  • Content in the Jetpack Search API is blocked and can no longer be accessed by a site. This will cause the site to fall back to Core WordPress database search. Jetpack Search can be configured for non-public content to be accessible via authenticated requests.
  • Content is blocked from consumption by the WordPress.com Reader.
  • Jetpack features (e.g. the Jetpack AI Assistant block) that require access to content will be blocked and will be unavailable or unable to operate as expected.

By default VIP_JETPACK_IS_PRIVATE is defined as true for:

  • Jetpack site connections on non-production environments. For WordPress multisite, this includes Jetpack connections for all network sites.
  • Sites on an environment that have IP Allow List or Basic Authentication enabled. Even if VIP_JETPACK_IS_PRIVATE is overridden in custom application code and defined as false, IP Allow List or Basic Authentication will continue to restrict public traffic from accessing sites on the environment.

Code-disabling content distribution

For environments that have Jetpack’s content distribution tools enabled by default, content distribution can be disabled by defining VIP_JETPACK_IS_PRIVATE as true to override the default setting.

It may be desirable to disable Jetpack content distribution for sites that rely on restricting access via plugins or mechanisms that are not native to the VIP Platform (e.g. paywalls).

Disable content distribution for all sites on an environment by defining VIP_JETPACK_IS_PRIVATE as false in vip-config.php:

/vip-config/vip-config.php
if ( ! defined( 'VIP_JETPACK_IS_PRIVATE' ) ) {
	define( 'VIP_JETPACK_IS_PRIVATE', true );
}

After the updated code is deployed, the default content distribution features that are included with Jetpack will be disabled within 30 minutes.

For sites that require more customization for restricted access to their content, specific Jetpack content distribution features can be selectively enabled or disabled with the jetpack_get_available_modules filter.

Disable for a network site on a multisite

On a WordPress multisite environment, Jetpack’s content distribution can be code-disabled for one or more specific network sites.

In this code example, content distribution is disabled for a network site with the domain site.example.com:

/vip-config/vip-config.php
if ( 'site.example.com' === $_SERVER['HTTP_HOST'] ) {
    define( 'VIP_JETPACK_IS_PRIVATE', true );
}

This code example demonstrates disabling content distribution for a network site that has a site URL with a subdirectory structure:

/vip-config/vip-config.php
if ( 'example.com' === $_SERVER['HTTP_HOST'] &&
	0 === strpos( $_SERVER['REQUEST_URI'], '/subdirectory-example/' )
) {
    define( 'VIP_JETPACK_IS_PRIVATE', true );
}

Prevent Jetpack from automatically connecting

If Jetpack is enabled for a site, it will automatically connect to WordPress.com when the site launches. It might take a few minutes for a site’s connection to Jetpack to appear active after a site launch.

A process will run every hour after that to check that the connection is still active. If the connection is not active, the system will attempt to reconnect.

If an environment needs to be opted out of this behavior, define VIP_JETPACK_AUTO_MANAGE_CONNECTION as false in vip-config.php:

/vip-config/vip-config.php
define( 'VIP_JETPACK_AUTO_MANAGE_CONNECTION', false );

Prevent Jetpack from loading

To prevent Jetpack from loading in an environment define VIP_JETPACK_SKIP_LOAD as true in vip-config.php:

/vip-config/vip-config.php
define( 'VIP_JETPACK_SKIP_LOAD', true );

Caution

This is uncommon and will completely skip loading Jetpack. Be aware that the environment may lose required functionality and features (e.g., Jetpack Activity Log, Jetpack Social, Jetpack SSO). Do not add this constant unless it has been fully tested against the application on a non-production environment, and there is confidence that Jetpack features will not be used any time in the future.

Last updated: March 18, 2024

Relevant to

  • WordPress