true), 'objects'); $selected_post_types = abst_get_admin_setting('selected_post_types'); $add_canonical = abst_get_admin_setting('ab_change_canonicals') ? 'checked' : ''; // Cache clearing is on unless the user has turned it off. $enable_clear_cache = (abst_get_admin_setting('ab_dont_clear_cache_on_update') == '1') ? '' : 'checked'; $detected_caches = !empty(abst_get_detected_caches()) ? implode(', ', abst_get_detected_caches()) : 'None detected'; // Don't send events until cookie consent is given; saves to session storage until approved. $wait_for_approval = abst_get_admin_setting('abst_wait_for_approval') ? 'checked' : ''; // Heatmap data retention, in days (minimum 1, default 3). $heatmap_retention_length = max(1, intval(abst_get_admin_setting('abst_heatmap_retention_length'))); $enable_user_journeys = abst_get_admin_setting('abst_enable_user_journeys'); $enable_user_journeys = ($enable_user_journeys && $enable_user_journeys !== '0') ? 'checked' : ''; $mcpServerName = str_replace('.', '-', get_bloginfo('url')); $mcpServerName = str_replace(array('http://', 'https://'), '', $mcpServerName); $mcpServerName = 'wordpress-' . $mcpServerName; ?>

Need a hand? Watch the walkthrough video or check out the documentation.

Welcome to AB Split Test

Watch the quick video that explains everything.

Version

Get started with A/B testing on your WordPress site.

Quick Start

1. Install and activate the plugin

2. Create your first test from any post or page

3. Watch conversions roll in!

View Documentation

Testing

Choose the post types that you would like the option of testing on.

name, $selected_post_types) ? 'checked' : ''; ?> />

To avoid SEO duplicate content issues. Adds the default page from your full page split test as a canonical link on the variation page.

/> Add canonical links.

Conversions

A test counts a conversion when a visitor does one of these:

  • ✓ Page or Post Visit
  • ✓ Element Click (any CSS selector)

Choose the goal on each test.

Tracking & Privacy

With this enabled, AB Split Test will wait for cookie consent before sending test data.

/> Enable wait for approval.

More Information.

Heatmaps

Track anonymized visitor journeys and key interactions like clicks and navigation to build click insights for your visitors.

Generates heatmaps by page / test / variation / size.

/> Enable heatmaps


Heatmaps are recorded anonymously on every page of your site. Choose the page shown first when you open the heatmap viewer.


Data Retention

days


Developer

AB Split Test integrates with anything via the REST API or MCP (Model Context Protocol).

Available Tools

The following tools are available over the REST API and MCP:

  • create-test - Create new A/B tests (magic, ab_test, full_page)
  • list-tests - List all tests with their configurations
  • get-test-results - Get detailed results for a specific test
  • update-test-status - Change test status (publish, draft, pending, complete)
  • update-test-settings - Update the conversion goal and other settings on an existing test
  • get-test-details - Get the full configuration of a specific test

REST API Endpoints

Access AB Split Test programmatically via REST API. Base URL:

  • POST /create-test - Create new tests
  • GET /list-tests - List all tests
  • GET /test-results/{id} - Get test results
  • POST /update-test-status - Update test status
  • POST /update-test-settings - Update the conversion goal and settings
  • GET /test-details/{id} - Get a test's full configuration

Requires WordPress Application Password for authentication.

📋 Example: Create a Magic Test via API

Scenario: Create a magic test for the H1 headline on page ID 12 that compares the original headline with one new headline, counting a visit to the thank-you page (page ID 34) as the conversion.

cURL Example:

curl -X POST "" \

  -u "your-username:your-application-password" \

  -H "Content-Type: application/json" \

  -d '{

    "test_title": "Homepage H1 Headline Test",

    "test_type": "magic",

    "status": "publish",

    "target_percentage": "50",

    "conversion_type": "page",

    "conversion_page_id": 34,

    "magic_definition": [

      {

        "type": "text",

        "selector": ".page-id-12 h1",

        "scope": {

          "page_id": 12,

          "url": "homepage"

        },

        "original": "Original Headline",

        "variation": "New Compelling Headline"

      }

    ]

  }'

JavaScript (Fetch) Example:

const credentials = btoa('your-username:your-application-password');



fetch('', {

  method: 'POST',

  headers: {

    'Content-Type': 'application/json',

    'Authorization': 'Basic ' + credentials

  },

  body: JSON.stringify({

    test_title: 'Homepage H1 Headline Test',

    test_type: 'magic',

    status: 'publish',

    target_percentage: '50',

    conversion_type: 'page',

    conversion_page_id: 34,

    magic_definition: [

      {

        type: 'text',

        selector: '.page-id-12 h1',

        scope: {

          page_id: 12,

          url: 'homepage'

        },

        original: 'Original Headline',

        variation: 'New Compelling Headline'

      }

    ]

  })

})

.then(response => response.json())

.then(data => console.log('Test created:', data));

Key Parameters:

  • test_title: Test name for identification
  • test_type: "magic" for magic tests
  • status: "publish" (active), "draft" (inactive), "pending", or "complete"
  • target_percentage: Percentage of visitors to include (0-100)
  • conversion_type: "page" - a conversion is counted when a visitor reaches the page in conversion_page_id; "selector" - when a visitor clicks an element matching conversion_selector
  • conversion_page_id: WordPress ID of the conversion page (page goal)
  • conversion_selector: CSS selector of the element to click, e.g. .buy-button (selector goal)
  • magic_definition: Array of elements to test, each with its original and its variation
  • scope: Optional but recommended page targeting metadata. Use page_id (WordPress page/post ID) or url (path fragment) or both for precise targeting
  • selector: CSS selector for the element to test
  • original: The element's current text
  • variation: The text to test against the original

Note: Replace "your-username" and "your-application-password" with your WordPress credentials. For magic tests, each element has its original text and its variation. For backward compatibility, the API still accepts legacy aliases such as name and conversion_page, but new integrations should send the canonical fields shown above.

MCP Integration (AI Assistants)

Connect AI assistants like Claude Desktop, OpenClaw, ChatGPT and more to create, manage and analyze your A/B tests directly.

⚠️ WordPress MCP Adapter Required

The WordPress MCP Adapter plugin is not installed.

To use the MCP integration with AB Split Test, install and activate the WordPress MCP Adapter plugin first.

Step 1: Install WordPress MCP Adapter Plugin

  1. Get the WordPress MCP Adapter from its releases page on GitHub (download the zip)
  2. Go to Plugins → Add New Plugin and click Upload Plugin
  3. Choose the zip, click Install Now, then Activate Plugin
  4. Come back to this tab for the connection steps

Requirements: WordPress 6.9 or higher

The WordPress MCP Adapter is active and ready to use. AB Split Test tools are now available via MCP.

Step 1: Create WordPress Application Password

AI clients need authentication to access your WordPress site:

  1. Go to Users → Profile
  2. Scroll to Application Passwords section
  3. Enter a name (e.g., "Windsurf MCP")
  4. Click Add New Application Password
  5. Copy the generated password (you won't see it again!)

Step 2: Configure Your AI Client

Your WordPress username for MCP authentication

Paste your Application Password - spaces will be automatically removed

; fragments are escaped as they are concatenated. The // only raw HTML is the two placeholder spans the config JS rewrites live. $abst_mcp_url = rest_url( 'mcp/mcp-adapter-default-server' ); $abst_mcp_user_span = '' . esc_html( wp_get_current_user()->user_login ) . ''; $abst_mcp_pass_span = 'YOUR_APPLICATION_PASSWORD'; $abst_mcp_json = function( $root ) use ( $abst_mcp_url, $abst_mcp_user_span, $abst_mcp_pass_span, $mcpServerName ) { return "{\n" . ' "' . esc_html( $root ) . "\": {\n" . ' "' . esc_html( $mcpServerName ) . "\": {\n" . " \"command\": \"npx\",\n" . " \"args\": [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"],\n" . " \"env\": {\n" . ' "WP_API_URL": "' . esc_html( $abst_mcp_url ) . "\",\n" . ' "WP_API_USERNAME": "' . $abst_mcp_user_span . "\",\n" . ' "WP_API_PASSWORD": "' . $abst_mcp_pass_span . "\"\n" . " }\n }\n }\n}"; }; $abst_mcp_clients = array( 'windsurf' => array( 'title' => 'Windsurf IDE', 'intro' => 'Add to your .windsurf/mcp_config.json:', 'code' => $abst_mcp_json( 'mcpServers' ), ), 'claude' => array( 'title' => 'Claude Desktop', 'intro' => 'Add to your Claude Desktop config file.
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json', 'code' => $abst_mcp_json( 'mcpServers' ), ), 'claude_code' => array( 'title' => 'Claude Code', 'intro' => 'Run once in your terminal (from any directory):', 'code' => 'claude mcp add ' . esc_html( $mcpServerName ) . ' \\' . "\n" . ' --env WP_API_URL=' . esc_html( $abst_mcp_url ) . ' \\' . "\n" . ' --env WP_API_USERNAME=' . $abst_mcp_user_span . ' \\' . "\n" . ' --env WP_API_PASSWORD=' . $abst_mcp_pass_span . ' \\' . "\n" . ' -- npx -y @automattic/mcp-wordpress-remote@latest', ), 'codex' => array( 'title' => 'Codex CLI (OpenAI)', 'intro' => 'Add to ~/.codex/config.toml:', 'code' => '[mcp_servers.' . esc_html( str_replace( '-', '_', $mcpServerName ) ) . "]\n" . "command = \"npx\"\n" . "args = [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"]\n" . "\n" . '[mcp_servers.' . esc_html( str_replace( '-', '_', $mcpServerName ) ) . ".env]\n" . 'WP_API_URL = "' . esc_html( $abst_mcp_url ) . "\"\n" . 'WP_API_USERNAME = "' . $abst_mcp_user_span . "\"\n" . 'WP_API_PASSWORD = "' . $abst_mcp_pass_span . '"', ), 'cursor' => array( 'title' => 'Cursor', 'intro' => 'Add to ~/.cursor/mcp.json (or .cursor/mcp.json inside a project):', 'code' => $abst_mcp_json( 'mcpServers' ), ), 'cline' => array( 'title' => 'Cline (VS Code Extension)', 'intro' => 'Add to Cline\'s MCP settings file (~/.cline/mcp.json, or the MCP settings JSON in the extension):', 'code' => $abst_mcp_json( 'mcpServers' ), ), 'openclaw' => array( 'title' => 'OpenClaw', 'intro' => 'Add to ~/.openclaw/openclaw.json (note the nested mcp.servers shape), then restart the gateway:', 'code' => "{\n" . " \"mcp\": {\n" . " \"servers\": {\n" . ' "' . esc_html( $mcpServerName ) . "\": {\n" . " \"command\": \"npx\",\n" . " \"args\": [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"],\n" . " \"env\": {\n" . ' "WP_API_URL": "' . esc_html( $abst_mcp_url ) . "\",\n" . ' "WP_API_USERNAME": "' . $abst_mcp_user_span . "\",\n" . ' "WP_API_PASSWORD": "' . $abst_mcp_pass_span . "\"\n" . " }\n }\n }\n }\n}", ), 'hermes' => array( 'title' => 'Hermes Agent (Nous Research)', 'intro' => 'Add under the top-level mcp_servers key in ~/.hermes/config.yaml, then run /reload-mcp or restart:', 'code' => "mcp_servers:\n" . ' ' . esc_html( $mcpServerName ) . ":\n" . " command: \"npx\"\n" . " args: [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"]\n" . " env:\n" . ' WP_API_URL: "' . esc_html( $abst_mcp_url ) . "\"\n" . ' WP_API_USERNAME: "' . $abst_mcp_user_span . "\"\n" . ' WP_API_PASSWORD: "' . $abst_mcp_pass_span . '"', ), ); foreach ( $abst_mcp_clients as $abst_mcp_key => $abst_mcp_client ) : ?>

 array( 'class' => true ) ) );
                    ?>

Step 3: Copy Configuration & Connect

Your configuration is ready to use:

  1. Copy the configuration for your AI client (Windsurf, Claude Desktop, Claude Code, Codex, Cursor, Cline, OpenClaw or Hermes) from below
  2. Paste it into your MCP client's configuration file
  3. Restart your MCP client to load the new configuration. Load a new conversation, as old conversations generally cache the previous configuration
  4. The AB Split Test tools should appear in your AI assistant's available tools
  5. Try asking: "List all my A/B tests" or "Create a test of the home page against the new landing page we just generated, conversion is reaching the thank-you page"

Example: Ask Your AI Assistant

Create a Magic Test:

"Create a magic A/B test called 'Homepage Headline Test' that tests the h1 element against a new headline, 'Start Free Today'. Count a visit to the thank-you page as the conversion."

List Tests:

"Show me all my A/B tests"

Get Results:

"Get the results for test ID 3504"

Troubleshooting

  • Tools not appearing: Make sure WordPress MCP Adapter plugin is installed and activated
  • Authentication errors: Verify your Application Password is correct (no spaces)
  • Connection errors: Check that your WordPress site URL is correct and accessible
  • Minimum WordPress 6.9: The Abilities API is only available in WordPress 6.9+ and requires MCP adapter plugin to function.

Danger Zone

AB Split Test can automatically clear caches when a post or test is updated. Leave this on unless you manage cache clearing yourself - stale caches can show visitors outdated test variations.

/> Clear caches when tests or tested posts are updated.

Detected caches: