Guides

How to Integrate SnagRelay Widget into WordPress

Add a visual bug reporting widget to WordPress with the element, requests, session replay and error capture via plugin or manual install—WooCommerce ready.

How to Integrate SnagRelay Widget into WordPress

Overview

Add SnagRelay to your WordPress site for easy bug reporting with the element, requests, session replay and automatic context capture. Choose between our official WordPress plugin or manual integration.

Prerequisites

  • A SnagRelay account (sign up free)
  • Your SnagRelay API key
  • WordPress 6.3 or higher
  • Administrator access to your WordPress site

Method 1: WordPress Plugin (Recommended)

Installation

  1. Log in to your WordPress admin dashboard
  2. Navigate to Plugins → Add New
  3. Search for "SnagRelay"
  4. Click Install Now, then Activate

Configuration

  1. Go to Settings → SnagRelay
  2. Enter your API key from the SnagRelay dashboard
  3. Configure visibility options:
    • Everyone: public bug reporting
    • Logged-in users: internal team feedback
    • Specific roles: for example administrators only, for admin-only testing
  4. Click Save Changes

Plugin Features

  • Role-based visibility — Control who sees the widget
  • WooCommerce support — Works on shop pages
  • Multisite compatible — Works on WordPress multisite networks
  • WordPress snapshot: versions, theme, active plugins, recent updates and PHP warnings from that request are attached to every report. Each group can be switched off in the settings. See SnagRelay for WordPress
  • No code required — Simple settings page

Method 2: Manual Integration

If you prefer not to use the plugin, you can add SnagRelay manually.

Option A: Theme Functions

Add this to your theme's functions.php file or a custom plugin:

<?php
function add_snagrelay_widget() {
    $api_key = 'YOUR_API_KEY'; // Replace with your API key
    
    echo "<script>
        window.onSnagRelayLoad = function (api) {
            api.init();
        };
        var script = document.createElement('script');
        script.defer = 1;
        script.src = 'https://app.snagrelay.com/widget/load/{$api_key}?onload=onSnagRelayLoad';
        document.getElementsByTagName('head')[0].appendChild(script);
    </script>";
}
add_action('wp_footer', 'add_snagrelay_widget');
?>

Option B: Theme Header/Footer

If your theme supports custom scripts in the header or footer:

  1. Go to Appearance → Theme Editor (or your theme's customizer)
  2. Find the footer scripts section
  3. Add the SnagRelay script:
<script>
    window.onSnagRelayLoad = function (api) {
        api.init();
    };
    var script = document.createElement('script');
    script.defer = 1;
    script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
    document.getElementsByTagName('head')[0].appendChild(script);
</script>

Option C: Header/Footer Plugin

Use a plugin like "Insert Headers and Footers" to add the script without editing theme files.

That's It!

The widget configuration (position, colors, button text, session replay settings, etc.) is managed in your SnagRelay dashboard. Any changes you make there will automatically apply to your widget.

Best Practices

  • Use the plugin — It's the easiest way to manage settings
  • Child theme — If editing functions.php, use a child theme to survive updates
  • Staging first — Test the integration on a staging site before production
  • Cache clearing — Clear your WordPress cache after adding the widget

Troubleshooting

Widget not appearing?

  • Clear all WordPress caches (plugin caches, CDN, browser)
  • Check for JavaScript errors in browser console
  • Verify your API key is correct
  • Check if another plugin is conflicting

Next Steps

  • Invite your team or clients to collaborate
  • Set up integrations with your project management tools
  • Configure notification preferences in your dashboard

Further Reading

After install

What you get after install

Every report arrives in your inbox or tracker with the evidence already attached:

  • The element

    What the reporter pointed at: label, component and selector. Errors tied to it are outlined in red.

  • Console and JS errors

    With file and line, captured up to the moment of the report.

  • Network requests

    Status, URL and request and response bodies, failed and successful.

  • Session replay

    The moments leading up to the bug, with repro steps.

  • Environment

    URL, browser, OS and viewport, plus the screenshot. On paid plans, also video.

Optional

Connect your agent

Add the SnagRelay MCP server once, then paste a prompt that tells your agent to call get_issue_context. After you review the fix, mark_issue_resolved emails the reporter. MCP is on every plan.

https://mcp.snagrelay.com/v1

Add this URL as a remote MCP server, then click Allow. Paste a prompt that tells the agent to call get_issue_context, then mark_issue_resolved only after you have reviewed the fix.

More articles

For WordPress agencies

Get complete bug reports from your WordPress clients.

The plugin sends the WordPress snapshot, replay, console and requests with each report. It does not give an agent write access to the site.

Get the WordPress plugin

Installs from the WordPress plugin directory.

See the WordPress plugin