Documentation

Learn how to install the plugin, configure tests, manage notifications,
review results, and integrate visual testing into your CI/CD workflow via API.


Plugin Installation

To install the plugin on your website, choose one of the following approaches.

Note: The website must be publicly accessible in order to set up and run the tests. Password protection or any kind of firewall might prevent the plugin from working correctly. You may whitelist the screenshotter IP.

—

Install from WordPress

  1. Log in to your WordPress admin dashboard.
  2. Navigate to Plugins > Add New.
  3. In the search bar, type “vrts”.
  4. Locate the Visual Regression Tests plugin in the results.
  5. Click Install Now, then Activate once installation is complete.

—

Download the plugin

  1. Visit the Visual Regression Tests plugin page.
  2. Click the Download button to get the plugin’s ZIP file.
  3. In your WordPress dashboard, go to Plugins > Add New.
  4. Click on Upload Plugin.
  5. Choose the downloaded ZIP file and click Install Now.
  6. Activate the plugin after installation.

—

Install via Composer

If you use Composer for dependency management, you can install the plugin via wpackagist:

composer require wpackagist-plugin/visual-regression-tests

After installation, ensure the plugin is activated in the WordPress backend or via WP Cli.


Test Configuration

Proper test configuration is crucial for accurate visual regression testing. Below are the key configuration options.

—

Screenshot Size

VRTs captures screenshots with a fixed viewport width of 1280 pixels minus the browser scrollbar. This results in an effective width of about 1265 pixels for most websites. The height automatically adjusts to the page content.

—

Adding Tests

You can add any public post or page, including custom post types, to VRTs. There are three ways to do this:

  1. From within the VRTs plugin: Go to Tests > Add New, select the post or page you want to test from the list and add it to VRTs.
  2. From within a post type: Navigate to the posts or pages list of your desired post type. Use the Bulk Actions dropdown menu, select Add to VRTs, and apply it to add multiple items to VRTs at once.
  3. From within a post or page: Navigate to the VRTs meta box in the sidebar and activate the option “Add to VRTs”.

—

Alert Threshold

Choose how much change should trigger an alert. This setting applies to all tests.

Available options:

  • Any change: Alert on any detected visual difference.
  • Small (1%): Alert when the difference exceeds 1%.
  • Medium (10%): Alert when the difference exceeds 10%.
  • Large (25%): Alert when the difference exceeds 25%.
  • Huge (50%): Alert when the difference exceeds 50%.

The threshold applies to the most-changed screen (viewport) of the page. An alert is only triggered when the difference exceeds the selected threshold.

Change the alert threshold:

  1. Open the VRTs Settings.
  2. Find Alert threshold.
  3. Select your preferred threshold and save your settings.

Note: Higher thresholds reduce alerts but can also suppress unexpected changes. Use Any change for tests where even small differences need attention. If only selected pages produce false alerts, use custom CSS or JavaScript to stabilize those tests rather than reducing sensitivity for all tests.

—

Click Element

Define an element that should be clicked before taking a screenshot. This is useful for closing cookie banners or modals.

How to configure:

  • In the Settings, find the Click Element field.
  • Enter a CSS selector for the element to be clicked.

Note: If multiple elements are found for the specified selector, only the first occurrence of the element will be clicked.

—

Custom CSS and JavaScript

Use custom CSS or JavaScript to give a changing element a consistent appearance in screenshots. The code runs only in the VRTs browser for this test. It does not change what visitors see.

  1. Open VRTs → Tests. Find the page and click its Test settings button in the Settings column. You can also open Test settings from an alert for that test or from the VRTs panel in the post editor.
  2. Choose style.css for styles or script.js for actions. Write your code or choose Insert example and replace the example selector with one from your page.
  3. Click Save. When you change the code, VRTs takes a new reference snapshot. Check that the moving content looks as intended and that the parts you want to monitor are still visible. Future runs compare against this reference.

CSS: hide a rotating ad without shifting the layout. If the ad sits in a fixed-size slot, hide the creative rather than the whole sidebar. The space it occupies stays in the screenshot, so you can still spot changes around it. Replace .promo-slot img with the selector for your ad image:

.promo-slot img {
  visibility: hidden !important;
}

JavaScript: show the same slide in every screenshot. VRTs runs your script after scrolling the page and before taking the screenshot. Pausing a slider alone can leave it on a different slide each time. This example stops autoplay and selects the first slide on a Swiper carousel with loop mode off. Replace .featured-slider with the selector for your Swiper container:

const slider = document.querySelector('.featured-slider')?.swiper;
slider?.autoplay?.stop();
slider?.slideTo(0, 0);

The first slide stays visible, so a broken image or a changed headline on it can still trigger an alert. Scripts can use await but must finish within 15 seconds. For a cookie banner, use the site-wide Click Element setting to click its consent button before capture.

Need help finding a selector? Under Ask your AI agent, copy the prompt. It includes the page URL, your test code and, when available, links to recent screenshots and captured HTML. Copying the prompt does not send it to an AI service.

—

User Agent

To ensure consistent test results, it can be useful to adjust how your website renders when tested by VRTs. For example, you might want to:

  • Disable animations
  • Hide dynamic or randomized elements
  • Remove ads, banners or popups
  • Freeze time-based content (e.g. countdowns, clocks)

Detecting VRTs via User Agent

VRTs sets a custom prefix in the user agent string during screenshotting:

VRTs/<version>; <full-user-agent>

To apply conditional logic during tests, you can check the user agent in JavaScript:

if (navigator.userAgent.includes('VRTs')) {
  // Adjust rendering for visual testing
  // e.g. disable animations or hide dynamic elements
}

Or on the server side, for example in PHP:

$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
if (strpos($userAgent, 'VRTs') !== false) {
  // Apply test-specific adjustments
  // e.g. serve static content
}

—

Testing Post Archives

The VRTs plugin primarily supports WordPress pages and posts. Automated visual testing of pages with dynamically changing content, such as archive pages, can lead to false positives. However, you can still test these pages by following these steps:

  1. Create a new blank page or post in WordPress.
  2. Set up a redirect from this new page to your desired archive or dynamic URL.
  3. Configure a test for this new page. The screenshotter will follow the redirect, capturing the target page.

Note: Archive content can change between captures and trigger false positives. Custom CSS or JavaScript can help reduce these alerts.

—

Whitelisting IPs

If your site uses a firewall to restrict access, you may need to whitelist our screenshotter and service IPs to ensure smooth functionality. Here’s what to do:

Screenshotter

The VRTs screenshotter browses and captures screenshots of your pages. Without it, testing won’t work. That’s why whitelisting these IPs is mandatory:

IPv4: 49.13.14.240
IPv6: 2a01:4f8:c012:2feb::1

Service

The VRTs service pushes test results to your site. If the push fails, the plugin automatically pulls the data instead. While whitelisting these IPs is optional, it’s strongly recommended for fast test result delivery:

IPv4: 167.235.246.223
IPv6: 2a01:4f8:c012:77bc::1

Example: Whitelisting an IP in Cloudflare

To whitelist the VRTs IP in Cloudflare, follow these steps:

  1. Log in to your Cloudflare account.
  2. Navigate to Security > WAF (Web Application Firewall).
  3. Click on Tools.
  4. In the IP Access Rules box, enter the IP address.
  5. Select Allow from the action dropdown.
  6. Optionally, add “VRTs Screenshotter” as a note to indicate this rule’s purpose.
  7. Click Add to apply the rule.

—

Multiple Environments

Using the VRTs plugin across different environments, like staging and production, allows you to test changes before pushing them live. However, when syncing environments, the plugin’s test data can be affected if not handled correctly. Here’s how to manage VRTs data effectively during deployment:

Steps for syncing environments

  1. Sync VRTs options to staging: Export the VRTs options from production and import them to staging to ensure settings consistency. You can do this by selecting all VRTs-related entries from the options table: SELECT * FROM wp_options WHERE option_name LIKE 'vrts_%';
  2. Exclude VRTs tables from production sync: To retain tests on production and avoid overwriting them, exclude the following tables when syncing:
    • vrts_alerts
    • vrts_tests
    • vrts_test_runs
    This prevents production tests from being overridden, allowing you to compare screenshots before and after the deployment.

Note: Syncing options back to staging is only necessary if plugin settings, like notification email, click element, or the license key, are changed.


Test Automation

There are multiple ways to trigger tests, ensuring you can monitor changes across different scenarios. Tests can be initiated automatically or manually, depending on your needs.

Note: Screenshots and comparisons are performed on an external server and sent to your WordPress website. All generated images are stored on AWS. Only required meta data is stored in your database.

—

Schedule

All tests are automatically scheduled to run every 24 hours, providing a daily snapshot and comparison of your site’s appearance. This continuous testing helps you promptly catch unexpected visual changes and ensures that the reference screenshot remains relevant for accurate comparisons.

—

Update

Tests are triggered automatically whenever updates occur, such as changes to plugins, themes, translations, or WordPress core. This ensures that any visual changes resulting from updates are detected, helping you maintain stability across upgrades.

How it works

  • Tests automatically run after updates to plugins, themes, translations or WordPress core.
  • The plugin uses WordPress hooks to ensure tests run whether you use auto-updates or external management tools.
  • Multiple updates are combined to minimize redundant tests. You may notice a brief delay before the update test starts, as it waits for any subsequent updates to be included.

Note: If you update dependencies directly on the file system, such as by using Composer or CI/CD, you’ll need to trigger tests via the API.

—

Manual

You can run tests manually on demand, either for all configured pages or for specific individual pages. Manual testing is ideal for verifying changes immediately after global edits, giving you instant feedback on visual integrity.

Run All Tests:

  • Navigate to Tests.
  • Click on Run All Tests to initiate a test run for all configured pages.

Run Individual Tests:

  • In the tests list, find the specific page.
  • Click the Run Test action to initiate a test run for this page.

—

API

Trigger tests via PHP scripts or WP CLI for integration with other tools, deployment pipelines or custom automations.

Capabilities:

  • Trigger all active tests.
  • Add optional notes (to label actions, versions, or deployment identifiers).

Triggering Tests via PHP

To trigger all tests from a PHP script on a site where the plugin is installed, use the following WordPress action:

do_action('vrts_run_tests', 'Your optional notes');

Triggering Tests via WP-CLI

If WP-CLI is available on your server, you can also trigger tests directly from the command line:

wp eval 'do_action("vrts_run_tests", "Your optional notes");'

User Notifications

When a test detects a visual change, VRTs can notify your team by email. With webhooks, you can also send the alert to other tools.

Email

Specify email addresses for each trigger, to set up notifications for various teams or stakeholders.

Example scenario for Triggers:

  • Schedule -> Client: Send test results directly to clients, allowing them to monitor site stability and handle alerts independently.
  • Update -> Support: Notify your support team of changes introduced by new versions, enabling them to quickly identify and address any issues.
  • API -> Devs & PM: Alert developers and PMs on deployments to verify that code changes are intentional and free of unintended side effects.
  • Manual -> User: Notifications for manual tests are automatically sent to the user who initiated the test, making it easy for any stakeholder to review their test results directly.

Note: If no email address is provided in the settings field for a specific trigger, no email notification will be sent. The tests will still run, and test results will appear in the plugin backend.

—

Webhooks

With VRTs Pro, you can send alerts to another tool. Enter its endpoint under VRTs → Settings → Webhook URL and save. After a Schedule, Update or API run with alerts, VRTs sends one JSON POST containing the run and its alerts. Manual runs and runs without alerts do not send a webhook. Clear the URL and save to turn it off.

Use an endpoint you trust: the payload includes the affected page URLs, links to screenshots and captured HTML, and the tests’ custom CSS and JavaScript.

Example webhook payload (JSON)
In this example, one of three tested pages changed after a plugin update. The hosts, paths and IDs below are illustrative. VRTs 2.3.0 normally uses images.vrts.app with UUIDs under /screenshots/ and /comparisons/. Use the URLs from the payload as sent. The previous_alerts list contains up to three earlier alerts for the page and is empty if there are none.

{
  "message": "VRTs found visual changes on 1 of 3 pages of example.com after updates. Compare the before and after screenshots and report whether each change is intended, a regression or noise (like animations, sliders or cookie banners).",
  "source": "VRTs",
  "version": 1,
  "event_id": "vrts-run-98765",
  "site": {
    "name": "Example Studio",
    "url": "https://example.com/",
    "alert_threshold": 1,
    "click_selectors": "#accept-cookies"
  },
  "run": {
    "id": 42,
    "trigger": "update",
    "trigger_note": "Elementor (3.25.0)",
    "started_at": "2026-11-25T09:00:00Z",
    "finished_at": "2026-11-25T09:01:12Z",
    "tests_count": 3,
    "admin_url": "https://example.com/wp-admin/admin.php?page=vrts-runs&run_id=42"
  },
  "alerts": [
    {
      "id": 73,
      "admin_url": "https://example.com/wp-admin/admin.php?page=vrts-runs&run_id=42&alert_id=73",
      "page": {
        "title": "About Us",
        "url": "https://example.com/about-us/"
      },
      "pixels_diff": 18432,
      "viewport_diff_percentage": 2.4,
      "before": {
        "taken_at": "2026-11-24T09:01:00Z",
        "image_url": "https://snapshots.vrts.app/BEFORE_ID.png",
        "html_url": "https://snapshots.vrts.app/BEFORE_ID.html"
      },
      "after": {
        "taken_at": "2026-11-25T09:01:02Z",
        "image_url": "https://snapshots.vrts.app/AFTER_ID.png",
        "html_url": "https://snapshots.vrts.app/AFTER_ID.html"
      },
      "diff_image_url": "https://diffs.vrts.app/DIFF_ID.png",
      "test_settings": {
        "custom_css": ".promo-badge { visibility: hidden; }",
        "custom_js": ""
      },
      "previous_alerts": [
        {
          "taken_at": "2026-11-20T09:00:58Z",
          "viewport_diff_percentage": 1.3,
          "diff_image_url": "https://diffs.vrts.app/DIFF_ID.png"
        }
      ]
    }
  ]
}

Test Review

Reviewing test results helps you identify and address visual changes efficiently. Below are tools and options to streamline your review process.

—

Scroll to Change

Find visual changes on long pages without searching manually.

How it works:

  • When no red highlights are visible in your current view, an indicator points towards a change outside it.
  • Click the indicator to scroll to the next change.
  • The indicator works in both directions, pointing down or up depending on where the change is located.

—

Read / Unread

Keep track of test results that require further attention by marking alerts as unread.

How it works:

  • Alerts are automatically marked as read when viewed.
  • A run is considered “read” when it contains no unread alerts.
  • To revisit a run you’ve already read, open it and select Mark all as unread.

—

Adjust a test from an alert

If the highlighted difference comes from something expected, such as a rotating ad, open Test settings in the alert toolbar. Add a rule for that element using Custom CSS and JavaScript. It applies to future captures; it does not change the screenshot you are reviewing.


Subscription

To upgrade, purchase a license key through the Upgrade menu item in the plugin. Once you have your license key, enter it to activate your subscription.

If your license key becomes inactive, all but three tests will be paused. You can reactivate the paused tests by re-entering a valid license key.


For further assistance or inquiries, visit the plugin’s support forum or contact us.