Tuesday, June 23, 2026
HomeEveryday WordPressAI integration, real-time collaboration, and more

AI integration, real-time collaboration, and more


Get the fireworks ready! With 7.0, WordPress enters a bold new era.

It’s likely the platform’s biggest leap in recent years. Now, you can collaborate with your team in real time—just like with Google Docs—and leverage an “agentic architecture” ready to interact with Large Language Models (LLMs).

But that’s just the beginning. In addition to real-time collaboration, WordPress 7.0 refines the admin interface and introduces new blocks and developer tools, such as the iframed post editor and PHP-only blocks.

Make yourself a cup of coffee and get comfortable because this is going to be a long and exciting read.

Integration with AI

With 7.0, WordPress has taken a major evolutionary leap. Forget the blogging platform of its early days. Today, WordPress is a collaborative platform natively ready for artificial intelligence.

This ambitious project aimed to provide a reliable, secure infrastructure enabling WordPress users and plugin developers to interact with Large Language Models (LLMs) in a standardized way.

The new architectural paradigm paves the way for “agentic WordPress”. It’s a shift towards agentic usability where WordPress is natively capable of interacting with external AI Agents via standardized, machine-friendly interfaces.

There’s a lot to say, but before getting into the details of the AI integration, here are some preliminary definitions.

WordPress AI architecture: Basic concepts

To understand the AI architecture of WordPress 7.0, it is essential to identify four critical components.

  • AI Client: A provider-agnostic AI infrastructure that provides a standardized way for WordPress PHP and JS code to interact with generative AI models. Because the AI Client is provider-agnostic, the system can operate independently of any particular AI provider.
  • AI Provider: The entity or company that develops, owns, and manages Large Language Models (LLMs), such as Anthropic, Google, and OpenAI.
  • Connector: The component that enables integration between WordPress and AI providers. WordPress 7.0 includes 3 default connectors—OpenAI, Anthropic, and Google—accessible from Settings > Connectors.
  • Abilities API: A new functional interface designed to allow plugins, themes, and WordPress core to expose their capabilities in both human- and machine-readable formats, enabling AI agents to interact with WordPress features (e.g., creating posts or adding an excerpt) in a structured way. This is what makes WordPress 7.0 natively agentic.
Connectors screen in WordPress 7.0.

Connectors

Previous versions of WordPress required a plugin for each AI provider you wanted to use on your site. WordPress 7.0 introduces a unified interface for managing AI Connectors under Settings > Connectors.

You no longer need to paste your API keys in multiple places. Enter your keys once on the Connectors screen, and all compatible plugins can use that connection through the AI Client.

Additionally, the new interface lets you switch between AI providers from a single location without risking breaking anything.

In the Connectors interface, click the Install button for your AI provider and enter your API key. Save your settings, and you’re ready to interact with the AI provider on your WordPress site.

Adding an API key in the Connectors interface
Adding an API key in the Connectors interface

If you’re not sure where to begin, install and activate the AI Experiments plugin. This plugin lets you add AI-generated featured images, alt text, excerpts, and more.

AI Experiments plugin settings
AI Experiments plugin settings

The new AI integration not only introduces a new user interface but also enables developers to register new AI providers via the Connectors API.

Developers can now register and manage connectors using the new core classes and methods. After being registered, each connector appears as a card on the Connectors screen.

The new API also provides three public functions.

  • wp_is_connector_registered(): Checks if a connector is registered.
  • wp_get_connector(): Retrieves a single connector’s data.
  • wp_get_connectors(): Retrieves all registered connectors.

In addition, the new action hook wp_connectors_init enables you to override the metadata of registered connectors.

Building with the AI Client

The Connectors screen provides the AI interface. The AI Client is the engine under the hood—a unified abstraction layer that standardizes how WordPress interacts with AI. Whether it’s OpenAI, Anthropic, or Google Gemini, your code remains the same. WordPress handles the translation, allowing you to focus on your application’s logic.

The new wp_ai_client_prompt() function is at the heart of this implementation.

Here is a simple example in PHP:

$ai_response = wp_ai_client_prompt( "Create a professional post about WordPress" )
	->generate_text();

if ( is_wp_error( $ai_response ) ) {
	wp_die( $ai_response->get_error_message() );
}

echo wp_kses_post( $ai_response );

The following example shows how you define the response schema to make the data ready to use.

$taxonomy_schema = array(
	'type'       => 'object',
	'properties' => array(
		'category' => array( 'type' => 'string' ),
		'tags'     => array( 
			'type'  => 'array',
			'items' => array( 'type' => 'string' )
		),
	),
	'required'   => array( 'category', 'tags' ),
);

$post_body = "Working from a small tavern in Crete was a game-changer. I realized that Greece is becoming the ultimate hub for remote workers in 2026.";

$json = wp_ai_client_prompt( "Based on this text, suggest the most appropriate category and 3-5 relevant tags: $post_body" )
	->using_temperature( 0.1 )
	->as_json_response( $taxonomy_schema )
	->generate_text();

if ( is_wp_error( $json ) ) {
	return $json;
}

$suggested_taxonomies = json_decode( $json, true );

In this code,

  • With as_json_response(), WordPress ensures the output is pure JSON that conforms to the specified schema ($taxonomy_schema).
  • using_temperature() controls the AI’s response, making it more or less deterministic (or random). A low temperature (0.1) yields greater precision, while a high temperature encourages a more creative response.
  • The $suggested_taxonomies array provides the categories and tags generated by the AI. You can automatically assign these to your post.

A structured output ensures predictable results and provides an ideal format for use with the Abilities API. For instance, the code above could be used to automatically create a post with the specified category and tags.

The API doesn’t just support text. Thanks to the generate_image() method, the AI Client can also generate images.

You can request multiple results with a single call. For instance, you can request 3 text or image options by passing a numeric value to the generate_text() or generate_image() methods: calling generate_image( 3 ) returns 3 variations of the same image.

The API also provides a set of methods that return additional information. These methods return a GenerativeAiResult object containing rich metadata, such as token usage, the provider, and the model that responded to the prompt:

  • generate_text_result()
  • generate_image_result()
  • convert_text_to_speech_result()
  • generate_speech_result()
  • generate_video_result()

As you can see, these methods offer a range of additional features, including support for text-to-speech, speech, and video conversion.

Other API methods include:

  • using_max_tokens(): Limit the length of the response (e.g. ->using_max_tokens( 500 ))
  • using_model_preference(): Set a specific model (e.g. ->using_model_preference( 'gemini-2.5-flash' ))

For a more in-depth analysis and additional code examples, refer to the WP AI Client GitHub project page and the changes made in preparation for WordPress 7.0.



Source link
RELATED ARTICLES
Continue to the category

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Most Popular

Recent Comments