AI Plugin for WordPress Development

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1 servicesAll 1566 services
AI Plugin for WordPress Development
Medium
~1-2 weeks
FAQ
AI Development Areas
AI Solution Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822

AI Plugin Development for WordPress

AI plugin for WordPress adds language models to WordPress ecosystem: content generation in editor block, AI chat widget for visitors, automatic SEO metadata, article summarization. Technically, PHP backend + JavaScript (React/Vanilla) frontend within WordPress Plugin API.

Plugin Architecture

<?php
/**
 * Plugin Name: AI Assistant
 * Version: 1.0.0
 */

if (!defined('ABSPATH')) exit;

class AIAssistant {

    private string $api_key;

    public function __construct() {
        $this->api_key = get_option('ai_assistant_api_key', '');

        add_action('rest_api_init', [$this, 'register_endpoints']);
        add_action('init', [$this, 'register_block']);
        add_action('admin_menu', [$this, 'add_settings_page']);
    }

    public function register_endpoints(): void {
        register_rest_route('ai-assistant/v1', '/generate', [
            'methods'  => 'POST',
            'callback' => [$this, 'generate_content'],
            'permission_callback' => function() {
                return current_user_can('edit_posts');
            },
        ]);

        register_rest_route('ai-assistant/v1', '/chat', [
            'methods'  => 'POST',
            'callback' => [$this, 'chat_response'],
            'permission_callback' => '__return_true',
        ]);
    }

    public function generate_content(\WP_REST_Request $request): \WP_REST_Response {
        $prompt = sanitize_text_field($request->get_param('prompt'));
        $type = sanitize_key($request->get_param('type'));

        if (empty($this->api_key)) {
            return new \WP_REST_Response(['error' => 'API key not configured'], 400);
        }

        $system_prompts = [
            'post' => 'You are a copywriter. Write SEO-optimized blog content.',
            'meta' => 'Create SEO meta description under 160 characters.',
            'summary' => 'Create brief article summary for featured snippet.',
        ];

        $response = $this->call_anthropic_api(
            $system_prompts[$type] ?? $system_prompts['post'],
            $prompt
        );

        return new \WP_REST_Response(['content' => $response]);
    }

    private function call_anthropic_api(string $system, string $user_message): string {
        $response = wp_remote_post('https://api.anthropic.com/v1/messages', [
            'headers' => [
                'x-api-key'         => $this->api_key,
                'anthropic-version' => '2023-06-01',
                'content-type'      => 'application/json',
            ],
            'body' => json_encode([
                'model'      => 'claude-haiku-4-5',
                'max_tokens' => 1024,
                'system'     => $system,
                'messages'   => [['role' => 'user', 'content' => $user_message]],
            ]),
            'timeout' => 30,
        ]);

        if (is_wp_error($response)) {
            throw new \RuntimeException($response->get_error_message());
        }

        $body = json_decode(wp_remote_retrieve_body($response), true);
        return $body['content'][0]['text'] ?? '';
    }
}

new AIAssistant();

Practical Case: Content Agency

Problem: agency publishes 30+ articles per week. Copywriters spent 30–40 min on SEO metadata and structure per article.

Solution: "AI Assistant" button in Gutenberg for generating structure, draft, meta title/description.

Result: article prep time: -45%. SEO metadata: 100% generated by AI, edited manually.

Timeline

  • Basic plugin with REST API: 3–5 days
  • Gutenberg block: 3–5 days
  • Chat widget for visitors: 3–5 days
  • WooCommerce integration (product descriptions): +1 week