Title: _wp_connectors_init
Published: May 20, 2026

---

# _wp_connectors_init()

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Initializes the connector registry with default connectors and fires the registration
action.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#description)󠁿

Creates the registry instance, registers built-in connectors (which cannot be unhooked),
and then fires the `wp_connectors_init` action for plugins to register their own
connectors.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#source)󠁿

    ```php
    function _wp_connectors_init(): void {
    	$registry = new WP_Connector_Registry();
    	WP_Connector_Registry::set_instance( $registry );

    	// Only register default AI providers if AI support is enabled.
    	if ( wp_supports_ai() ) {
    		_wp_connectors_register_default_ai_providers( $registry );
    	}

    	// Non-AI default connectors.
    	$registry->register(
    		'akismet',
    		array(
    			'name'           => __( 'Akismet Anti-spam' ),
    			'description'    => __( 'Protect your site from spam.' ),
    			'type'           => 'spam_filtering',
    			'plugin'         => array(
    				'file'      => 'akismet/akismet.php',
    				'is_active' => static function () {
    					return defined( 'AKISMET_VERSION' );
    				},
    			),
    			'authentication' => array(
    				'method'          => 'api_key',
    				'credentials_url' => 'https://akismet.com/get/',
    				'setting_name'    => 'wordpress_api_key',
    				'constant_name'   => 'WPCOM_API_KEY',
    			),
    		)
    	);

    	/**
    	 * Fires when the connector registry is ready for plugins to register connectors.
    	 *
    	 * Built-in connectors and any AI providers auto-discovered from the WP AI Client
    	 * registry have already been registered at this point and cannot be unhooked.
    	 *
    	 * AI provider plugins that register with the WP AI Client do not need to use
    	 * this action — their connectors are created automatically. This action is
    	 * primarily for registering non-AI-provider connectors or overriding metadata
    	 * on existing connectors.
    	 *
    	 * Use `$registry->register()` within this action to add new connectors.
    	 * To override an existing connector, unregister it first, then re-register
    	 * with updated data.
    	 *
    	 * Example — overriding metadata on an auto-discovered connector:
    	 *
    	 *     add_action( 'wp_connectors_init', function ( WP_Connector_Registry $registry ) {
    	 *         if ( $registry->is_registered( 'anthropic' ) ) {
    	 *             $connector = $registry->unregister( 'anthropic' );
    	 *             $connector['description'] = __( 'Custom description for Anthropic.', 'my-plugin' );
    	 *             $registry->register( 'anthropic', $connector );
    	 *         }
    	 *     } );
    	 *
    	 * @since 7.0.0
    	 *
    	 * @param WP_Connector_Registry $registry Connector registry instance.
    	 */
    	do_action( 'wp_connectors_init', $registry );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/connectors.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/connectors.php#L212)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/connectors.php#L212-L273)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#hooks)󠁿

 [do_action( ‘wp_connectors_init’, WP_Connector_Registry $registry )](https://developer.wordpress.org/reference/hooks/wp_connectors_init/)

Fires when the connector registry is ready for plugins to register connectors.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#related)󠁿

| Uses | Description | 
| [_wp_connectors_register_default_ai_providers()](https://developer.wordpress.org/reference/functions/_wp_connectors_register_default_ai_providers/)`wp-includes/connectors.php` |

Registers connectors for the built-in AI providers.

  | 
| [WP_Connector_Registry::set_instance()](https://developer.wordpress.org/reference/classes/wp_connector_registry/set_instance/)`wp-includes/class-wp-connector-registry.php` |

Sets the main instance of the registry class.

  | 
| [wp_supports_ai()](https://developer.wordpress.org/reference/functions/wp_supports_ai/)`wp-includes/ai-client.php` |

Returns whether AI features are supported in the current environment.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_connectors_init/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.0.0](https://developer.wordpress.org/reference/since/7.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_wp_connectors_init%2F)
before being able to contribute a note or feedback.