WordPress Integration

WordPress Feedback Tool

Add Valerie to your WordPress site in minutes. Choose from three installation methods based on your comfort level and site setup.

Choose Your Installation Method

Theme File Injection

Edit footer.php or use wp_footer hook. Best for developers.

Recommended

Plugin Insertion

Use a header/footer plugin. No coding required.

Easiest

Google Tag Manager

Deploy via GTM if you already use it. Centralized management.

Advanced

Method 1: Theme File Injection

Option A: Edit footer.php (Child Theme)

Add the script directly to your theme's footer.php file, just before the closing </body> tag.

<!-- Add before </body> in footer.php -->
<script src="https://talktovalerie.com/valerie/v1.js" 
        data-site-id="YOUR_SITE_ID" 
        async></script>
<?php wp_footer(); ?>

Always use a child theme to prevent losing changes on theme updates.

Option B: Use wp_footer Hook (functions.php)

Add this code to your child theme's functions.php file:

// Add to functions.php
function add_valerie_widget() {
    echo '<script src="https://talktovalerie.com/valerie/v1.js" 
                  data-site-id="YOUR_SITE_ID" 
                  async></script>';
}
add_action('wp_footer', 'add_valerie_widget');

Option C: wp_enqueue_script (Cleanest)

The WordPress-recommended way to add scripts:

// Add to functions.php
function enqueue_valerie_widget() {
    wp_enqueue_script(
        'valerie-widget',
        'https://talktovalerie.com/valerie/v1.js',
        array(),
        null,
        true // Load in footer
    );
    wp_script_add_data('valerie-widget', 'async', true);
}
add_action('wp_enqueue_scripts', 'enqueue_valerie_widget');

// Add data-site-id attribute
function add_valerie_site_id($tag, $handle) {
    if ('valerie-widget' !== $handle) {
        return $tag;
    }
    return str_replace(' src', ' data-site-id="YOUR_SITE_ID" src', $tag);
}
add_filter('script_loader_tag', 'add_valerie_site_id', 10, 2);

Method 2: Plugin Insertion (No Code)

If you're not comfortable editing theme files, use a plugin to inject the script. Popular options include:

Insert Headers and Footers

Free plugin by WPBeginner. Simple interface to add code to header or footer.

Header Footer Code Manager

Allows per-page script insertion if you want to exclude certain pages.

Steps:

  1. 1Install and activate your chosen plugin
  2. 2Navigate to the plugin settings (usually under Settings or Tools)
  3. 3Paste the Valerie script in the "Footer Scripts" section
  4. 4Save changes and verify on your site

Script to paste:

<script src="https://talktovalerie.com/valerie/v1.js" data-site-id="YOUR_SITE_ID" async></script>

Method 3: Google Tag Manager

If you already use GTM on your WordPress site, you can deploy Valerie through it. This is useful for centralized script management and consent mode integration.

We have a dedicated guide for GTM installation with step-by-step instructions, consent mode setup, and SPA support.

View GTM Installation Guide

Caching & Minification Caveats

WordPress caching and optimization plugins can sometimes interfere with external scripts. Here's how to handle common scenarios:

WP Rocket

Add talktovalerie.com to the "Excluded External JavaScript" list:

Settings → File Optimization → Exclude External JavaScript → Add: talktovalerie.com/valerie

W3 Total Cache

Exclude from minification by adding to "Never minify the following JS files":

Performance → Minify → JS → Never minify: talktovalerie.com

LiteSpeed Cache

Add to JS Excludes in Page Optimization settings:

LiteSpeed Cache → Page Optimization → JS Excludes: valerie

Autoptimize

Add to "Exclude scripts from Autoptimize":

Settings → Autoptimize → JS, CSS & HTML → Exclude scripts: talktovalerie

Clear Cache After Installation

After adding the Valerie script, clear your caching plugin's cache and any CDN cache (like Cloudflare) to ensure the script loads correctly on your live site.

WordPress-Specific URL Targeting

Valerie's URL targeting works great with WordPress permalink structures. Common patterns:

/blog/*All blog posts (default post type)
/product/*WooCommerce product pages
/shop/*WooCommerce shop pages
/cart/WooCommerce cart page
/checkout/WooCommerce checkout page
/category/*Category archive pages
/Homepage only (exact match)

Configure URL targeting in your Valerie dashboard after installation.Learn more about URL targeting →

Best Feedback Questions for WordPress Sites

Different WordPress sites have different goals. Here are question recommendations based on your site type:

Content Blogs & Publications

Focus on content quality and findability.

"Did this article answer your question?"

"What topic would you like us to cover next?"

"How easy was it to find this information?"

SaaS Marketing Sites

Understand what blocks signups and trial conversions.

"What's stopping you from signing up today?"

"What question do you still have about [product]?"

"How did you hear about us?"

WooCommerce Stores

Reduce cart abandonment and improve product discovery.

"What info would help you decide on this product?"

Use on: /product/*

"Anything stopping you from completing your order?"

Use on: /cart/

"How was your shopping experience today?"

Use on: order confirmation page

Ready to add feedback to WordPress?

Sign up for free, get your site ID, and install using any method above.