Split Tests releases
A/B testing plugin for WordPress
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/the-markup/split-tests/archive/refs/heads/main.zipBasic A/B testing for WordPress.
Description
A WordPress plugin to add A/B split tests without tracking individual users. Currently there are two kind of tests:
- Post title tests: test multiple headlines for a single post.
- DOM tests: test arbitrary changes to page content on DOM manipluations.
Depends on Advanced Custom Fields Pro plugin, which you will need to install and license separately.
Installation
This section describes how to install the plugin and get it working.
- Upload
split-tests/to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
Filters
split_tests_is_headless- return true from a filter handler if you are using this plugin on headless WordPress (redirects get handled differently).split_tests_endpoint_url- where JavaScript events should be sent (default is/wp-admin/admin-ajax.php?action=split_tests).split_tests_current_url- used to target on which pages tests will run (default is$_REQUEST['REQUEST_URI']).split_tests_is_single- whether a single post is being loaded (default is the result ofis_single()only for thepostpost type).split_tests_post_variant- used internally to modify a post.
Developer setup
This repo contains everything you need to get a test environment setup using the official WordPress docker image.
Developer dependencies
- node.js (tested on v22)
- nvm
- Docker Desktop
Build and start
./bin/build
./bin/start
Local website
Once you've built and started the docker containers, you can load up the website at localhost:8080. If you reload the page a couple times, you should see parts of the page change in response to two tests that are set up.
- DOM test: there are two variants for the about text "A commitment to innovation and sustainability" and "A commitment to maintenance and durability". If you click on the "About us" button, that will register as a conversion for a given variant.
- Post title: there are three variants for the Hello World post, if you scroll down to "Watch, Read, Listen" and reload you should see English, Spanish, and French versions of "Hello World." Clicking through to load the post will register as a conversion for that test.
WordPress admin credentials
Username: admin
Password: password
You can explore the example tests by clicking on Split Tests in the admin sidebar.
Frequently Asked Questions
Did you say there's no tracking?
Yes, we count how many times a test is seen and how many times it converts, but we don't set/read cookies or otherwise attempt to track individual requests.
How do you define a conversion?
There are currently three kinds of conversions: clicks, page loads, and scrolling.
Does the plugin handle front-end caching?
Yes, the tests will work fine with HTML generated behind a CDN, or using other kinds of front-end caching.
Screenshots
1. Split Tests posts page

2. Split Test post editor

3. Post Title variants

Changelog
0.1.2
- Updates a number of dependencies.
0.1.1
- Adds freeform CSS changes to DOM tests.
- Adds a scroll conversion option.
- Bugfix for title test post selection.
0.1.0
- Adds class changes to DOM tests.
- Improves how title tests sync publish status with their associated split test.
- Bugfix for database migrations.
- Bugfix for title test conversions.
0.0.9
- Adds a
split_tests_is_headlessfilter that changes how redirects are handled. - Bugfix: don't apply unpublished tests to the site.
0.0.8
- Bugfix: allow for zero title tests.
0.0.7
- Bugfix: undefined variable in title tests.
- Updates version of
@wordpress/scriptsto latest.
0.0.6
- Switch from REST API endpoints to
admin-ajax.php. - Adds
split_tests_endpoint_urlandsplit_tests_current_urlfilters (for headless). - Click conversions check up the DOM tree for a parent with an
hrefattribute if one isn't found on the click event target. - Fixes a case-sensitivity bug (
DomTestsinstead ofDOMTests).
0.0.5
- Filter on
the_titlefor post title tests - Add
split_tests_is_singlehook - Make JS more headless-friendly
0.0.4
Adds a cron mechanism to combine raw events in the database into daily aggregates
0.0.3
Context for where tests run ('all', 'home', or a 'url' pattern)
0.0.2
Split tests for DOM changes
0.0.1
Split tests for post titles
Releases
12 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.