WordPress feedback widget: add it in 2 minutes
Last updated:
How do I add a feedback widget to WordPress?
A WordPress feedback widget is one script tag in your site's footer. You do not need a dedicated plugin.
First, create a project in the dashboard, add your domain to Allowed domains, and copy the project key.
Option 1: child theme
Add this to your child theme's functions.php:
add_action('wp_footer', function () {
?>
<script src="https://commentpin.com/widget.js" data-project="YOUR_PROJECT_KEY" defer></script>
<?php
});
Only for logged-in users, for example during a review:
add_action('wp_footer', function () {
if (!is_user_logged_in()) {
return;
}
?>
<script src="https://commentpin.com/widget.js" data-project="YOUR_PROJECT_KEY" defer></script>
<?php
});
Option 2: a code snippet plugin
Use any plugin that adds code to the footer of every page, and paste:
<script src="https://commentpin.com/widget.js" data-project="YOUR_PROJECT_KEY" defer></script>
Check it works
Open the site, click the feedback button and send a test report.
More detail in the install docs. See client feedback for agencies, or the Webflow and Shopify guides.
Frequently asked questions
- Do I need a WordPress plugin?
- No. The widget is one script tag. You can add it with a few lines in a child theme, or with any plugin that adds code to the footer.
- Will theme updates remove it?
- Not if you use a child theme or a code snippet plugin. Edits to a parent theme are lost when it updates.
- Can I show it only to logged-in users?
- Yes. Wrap the snippet in a check for is_user_logged_in() in PHP.
- Does it work with page builders?
- Yes. The widget runs on the page in the browser, whatever builder made it.
- Does it work on WordPress.com?
- WordPress.com allows plugins on its paid plans, so you can use a code snippet plugin there. Free WordPress.com sites cannot add the script.