Tips & Tricks

Visual Feedback on WordPress Sites Without Another Plugin

Add a visual feedback widget to WordPress with one script tag: child theme code, block themes, Google Tag Manager, and when a snippet plugin is fine.

A stack of puzzle pieces set aside next to a browser window, with a slim green snippet going into its header.
A practical field guide
In this article 8 sections

The client’s WordPress site already runs 37 plugins. You need their feedback on the new landing pages for the next three weeks, and the obvious move is to install a 38th: a WordPress feedback plugin, with its own settings page, its own updates and its own place in next year’s security report.

You do not need it. A visual feedback widget like Zorko is one script tag, and WordPress has several clean places to put one. This post shows the code for each, where block themes get in the way, how to do it through Google Tag Manager, and when a snippet plugin is the sensible choice after all.

If you would rather have a plugin anyway, Zorko now has its own: the Zorko plugin for WordPress adds the same tag and lets you choose who sees the widget. This post is for everyone who prefers to keep the plugin list short.

Why not just another plugin

Plugins are not bad. Some feedback tools are built around WordPress on purpose (Atarim began life as a WordPress feedback plugin), and in that model the plugin makes sense. But when the tool itself only needs a script tag, a plugin adds things you then have to look after:

  • Another update to track on a site you may not maintain after launch.
  • More code with admin access on the client’s server, for a tool that only runs in the visitor’s browser.
  • Cleanup at the end. Plugins get forgotten. Script tags in a child theme get forgotten too, but they are easier to find with one search.

The Zorko tag looks like this. The widget key comes from your project in the dashboard:

<script type="module" src="https://zorko.app/widget/loader.js" data-widget-key="YOUR_WIDGET_KEY"></script>

No browser extension for the client, no account for them either. If you want the bigger picture first, see how the main types of feedback tools compare.

Option 1: a child theme and the wp_head hook

The cleanest home for the tag is functions.php in a child theme. Never the parent theme: its files are replaced on every theme update, and your tag goes with them.

The simplest version prints the tag straight into <head>:

<?php
// functions.php in the child theme
add_action( 'wp_head', function () {
    ?>
    <script type="module" src="https://zorko.app/widget/loader.js" data-widget-key="YOUR_WIDGET_KEY"></script>
    <?php
} );

wp_head only runs on the front end, so the widget never shows up inside wp-admin.

If you prefer wp_enqueue_script

Some teams want every script to go through the enqueue system, so that caching and optimisation plugins can see it by its handle. The catch: the tag must have type="module" and a data-widget-key attribute, and wp_enqueue_script has no argument for either. The usual fix is the script_loader_tag filter, which lets you replace the tag WordPress prints for one handle:

<?php
add_action( 'wp_enqueue_scripts', function () {
    // null version: no ?ver= query string added to the URL
    wp_enqueue_script( 'zorko', 'https://zorko.app/widget/loader.js', array(), null );
} );

add_filter( 'script_loader_tag', function ( $tag, $handle, $src ) {
    if ( 'zorko' !== $handle ) {
        return $tag;
    }
    return '<script type="module" src="' . esc_url( $src ) . '" data-widget-key="YOUR_WIDGET_KEY"></script>' . "\n";
}, 10, 3 );

WordPress 6.5 added wp_enqueue_script_module(), which prints type="module" for you. It has no parameter for custom attributes such as the widget key, so for a single tag the wp_head version above stays shorter.

Staging only, if you want

WordPress knows which environment it runs in when the host or wp-config.php sets WP_ENVIRONMENT_TYPE. Wrap the hook in a check and the same child theme can go to production without the widget:

<?php
function my_print_zorko_tag() {
    echo '<script type="module" src="https://zorko.app/widget/loader.js" data-widget-key="YOUR_WIDGET_KEY"></script>' . "\n";
}

if ( 'staging' === wp_get_environment_type() ) {
    add_action( 'wp_head', 'my_print_zorko_tag' );
}

One more practical note: plugins that combine, minify or delay JavaScript sometimes rewrite module scripts or hold them until the first click. If the widget does not appear, exclude zorko.app/widget in that plugin’s settings.

Block themes and the Site Editor

With a block theme (Twenty Twenty-Four, Twenty Twenty-Five and most new themes), the Site Editor gives you no field for code in <head>. That surprises people, but it does not block you:

  • A child theme still works. Block themes still fire wp_head, so the snippet from Option 1 runs unchanged.
  • A Custom HTML block in the footer template part will print a script tag for administrators allowed to post unfiltered HTML. It works, but the tag then lives in the database as part of an edited template, and it disappears the moment someone resets that template or switches theme. On multisite, only super admins can save it at all. Treat it as a quick test, not a setup.

Option 2: Google Tag Manager

If the site already loads a GTM container, you can add the widget without touching WordPress. Create a Custom HTML tag. Rather than depend on how GTM re-inserts script tags, build the element yourself, so type="module" and the key arrive exactly as written:

<script>
  (function () {
    var s = document.createElement('script');
    s.type = 'module';
    s.src = 'https://zorko.app/widget/loader.js';
    s.setAttribute('data-widget-key', 'YOUR_WIDGET_KEY');
    document.head.appendChild(s);
  })();
</script>

Fire it on a DOM Ready trigger: the widget attaches itself to the page body, which may not exist yet when a Page View tag runs. To limit it to staging, add a condition on Page Hostname equals your staging domain. Check it in GTM’s Preview mode, then publish the container.

Two things to watch. If the container uses consent settings, make sure this tag is not waiting for analytics consent, or it will stay hidden until someone accepts cookies. And remember who owns the container: if it belongs to the client’s marketing team, tell them what the tag is before they find it.

When a snippet plugin is fine

Sometimes code is not an option: the host sets DISALLOW_FILE_EDIT, there is no child theme and no one will make one, or you only have an editor account. A header-and-footer snippet plugin (WPCode and similar) is then a reasonable choice, and it is the right one if the site already has such a plugin installed. You are adding one tag to a tool that exists anyway, not a new plugin.

Paste the tag into the header box, save, and add a note in the client’s handover document saying where it lives, so it can be removed after launch.

Staging first, and who sees the widget

Most WordPress reviews happen on a staging copy, and you rarely want every visitor to see a feedback button. Zorko has a setting per project for exactly that: everyone, only people with the link, or off. New projects start as “only people with the link”: the widget stays hidden until the site is opened with ?zorko=KEY, the browser remembers it, and the server refuses reports without the key, so it is not just a hidden button. We covered the whole flow in how to share a staging site with clients.

One setting to check on WordPress in particular: the widget key only works on the project’s domains and their subdomains, plus localhost. staging.clientsite.com is covered if clientsite.com is on the list. A staging copy on a temporary address from your hosting panel is not, so add that address to the project’s domains in the project settings.

Count it at your end

An illustration, not data. Say you run feedback rounds on 10 client WordPress sites a year. With a plugin per site, that is 10 installs, updates for as long as each site stays up, and 10 removals you have to remember after launch. With a tag in the child theme, it is one line per site that you paste in two minutes and remove with one search. Multiply by your own number of sites and by how often “remove the feedback plugin” actually happens on your projects.

Ready to try it? Create a free Zorko account (1 project, 10 reports a month, no credit card), copy your tag and paste it into the child theme. For a walkthrough of what happens after the client clicks, see how the widget works.

FAQ

Will the widget slow down the WordPress site?

The tag is a type="module" script. Browsers treat module scripts as deferred, so they do not block the page from rendering.

Does it work with Elementor, Divi or other page builders?

Yes. Page builders render inside the theme, and wp_head runs either way. With Divi as the parent theme, put the code in a Divi child theme.

Will a theme update remove the tag?

Not if it lives in a child theme, a GTM container or a snippet plugin. It will if you edit the parent theme’s functions.php or header.php directly.

Will the client’s visitors see the feedback button?

Only if you set the project to “everyone”. In “only people with the link” mode it stays hidden for everyone who did not open the site with your key, and in “off” mode it is gone for all.

Zorko news in your inbox

Product updates and practical tips for agencies, about once a month. Nothing else.

Put it into practice

Give clients the right way to show what they mean.

Zorko keeps screenshot and desktop video feedback together with the page details your team needs to act.

Start free See how it works

Free includes 1 project and 10 feedbacks a month. No credit card required.