Give WordPress an AI Brain: WPMind User Guide

WordPress itself does not have built-in AI capabilities. To leverage AI for writing assistance, summary generation, or content translation, you either need to install numerous incompatible plugins—or write custom code to integrate with AI APIs.

WPMind (Wenpai Mind) is an AI infrastructure plugin for WordPress. Rather than implementing specific AI features itself, WPMind provides unified AI endpoint management—enabling other plugins and themes to directly call AI services, with support for both domestic and international AI providers.

Try It in 30 Seconds

No installation required—experience it instantly in your browser:

One-click preview of WPMind →

Clicking the link opens an online WordPress environment where WPMind is already installed and activated—taking you straight to its settings page.

Installation & Setup

Step 1: Install and Activate

In your WordPress admin dashboard, go to Plugins → Add New, then search for WPMind or Wenpai Mind, install it, and click Activate.

Alternatively, download the ZIP package manually from Wenpai Open Source and upload it via Plugins → Add New → Upload Plugin.

Step 2: Access Settings

After activation, locate the Mind menu item in the left-hand admin sidebar—or navigate directly to wp-admin/admin.php?page=wpmind.

Step 3: Configure AI Endpoints

WPMind supports multiple AI service providers. You can configure:

  • API Endpoint: Enter the API URL of your AI service (e.g., OpenAI, Anthropic, or major domestic LLMs).
  • API Key: The authentication key for your chosen service.
  • Model Selection: Specify the model name (e.g., gpt-4, claude-3-haiku, etc.).
  • Custom Endpoint: Supports self-hosted AI services or third-party APIs compatible with standard formats.

Step 4: Test the Connection

Once configured, use the “Test Connection” feature on the settings page to verify that your AI service is reachable and responding correctly. After confirmation, you’re ready to go.

What Can It Do?

WPMind operates at the infrastructure layer—the value lies in its foundational capabilities:

Capability Description
Unified Endpoint Management Configure once; all WPMind-compatible plugins automatically inherit the settings.
Multi-Model Support Seamlessly integrates OpenAI, Anthropic, and leading domestic LLMs.
Custom Endpoints Supports self-hosted AI services or any third-party API compliant with standard formats (e.g., OpenAI-compatible).
Centralized Security Control API keys are managed securely in one place—no risk of leakage across disparate plugins.

When combined with the AI Writing Station solution (WPMind + WPSlug), you get a complete workflow: AI-assisted writing plus automatic pinyin-based permalinks.

Frequently Asked Questions

Q: Do I need my own AI service API key?
A: Yes. WPMind is an endpoint management tool—you must provide your own API key. It supports mainstream services like OpenAI and Anthropic, as well as domestic AI models.

Q: Will it conflict with other AI plugins?
A: No. WPMind functions as infrastructure—providing a standardized interface. Other AI plugins may optionally integrate with WPMind’s endpoints, or operate independently.

Q: Which domestic AI models does it support?
A: Any service offering an OpenAI-compatible API format—including Tongyi Qwen (Qwen), ERNIE Bot (Baidu), GLM (Zhipu AI), and others providing such compatibility.

Related Recommendations

  • AI Writing Station — Combines WPMind + WPSlug for AI-powered writing and pinyin-based URLs.
  • Wenpai Full Suite — A complete set of five Wenpai plugins, including WPMind.
  • Wenpai Cloud Bridge — Manages external connections from WordPress—including access to AI services.

All plugins are available for instant, no-installation trial at the Wenpai Playground.

WPMind 作为 WordPress 的 AI 基础设施层,其核心价值在于通过标准化的接口(API)为其他插件和主题提供统一的 AI 服务调用能力。

对于开发者而言,这意味着可以专注于开发具体的 AI 应用功能(如内容生成、摘要、翻译),而无需重复编写 API 密钥管理、请求构造和错误处理等底层代码。

核心开发者接口:

WPMind 主要通过 WPMind 类提供静态方法供调用。以下是一个基础的使用示例,展示如何通过 WPMind 向配置好的 AI 端点发送请求:

// 假设这是你的插件或主题中的一个函数
function my_ai_assistant_generate_content( $prompt ) {
    // 检查 WPMind 是否可用
    if ( ! class_exists( 'WPMind' ) ) {
        return new WP_Error( 'wpmind_missing', 'WPMind 插件未激活。' );
    }

    // 准备请求参数
    $request_args = array(
        'model'       => 'gpt-3.5-turbo', // 模型名称,应与 WPMind 后台配置的模型标识符匹配
        'messages'    => array(
            array(
                'role'    => 'user',
                'content' => $prompt,
            ),
        ),
        'max_tokens'  => 500, // 可选:限制生成的最大令牌数
    );

    // 调用 WPMind 发送请求
    $response = WPMind::request( $request_args );

    // 处理响应
    if ( is_wp_error( $response ) ) {
        // 处理错误,例如记录日志或返回用户友好提示
        error_log( 'WPMind API 错误: ' . $response->get_error_message() );
        return 'AI 服务暂时不可用,请稍后再试。';
    }

    // 从标准化的响应结构中提取 AI 生成的内容
    // WPMind 会处理不同供应商的响应格式差异,返回统一结构
    if ( ! empty( $response['choices'][0]['message']['content'] ) ) {
        return trim( $response['choices'][0]['message']['content'] );
    }

    return '';
}

// 使用示例
$generated_text = my_ai_assistant_generate_content( '为 WordPress 写一句欢迎标语。' );
echo $generated_text;

关键优势:

  1. 解耦与标准化:你的插件代码只需与 WPMind 的接口交互,无需关心后端是 OpenAI、Anthropic 还是国内模型。
  2. 集中管理:API 密钥和端点配置在 WPMind 后台统一管理,提升了安全性,也方便用户切换或配置多个 AI 服务。
  3. 降低开发门槛:开发者无需深入研究各 AI 供应商的 SDK 和 API 差异,可以快速集成 AI 能力。

进阶用法:
你还可以利用 WordPress 的过滤器(Filters)来修改 WPMind 发出的默认请求参数,或处理其返回的响应,以实现更定制化的逻辑。

对于希望为 WordPress 生态添加 AI 功能的开发者,这是一个高效且可持续的架构方案。