Reviews: How to change link in Write a Review button

Looking for a way to change the link in the Write a Review button in your Reviews widget? We’ve got it covered!

Just add this code to the Custom JS field on the Style tab of your widget’s setting and you’ll be fine :wink:

const LINK = "https://g.page/r/CV21TXsdoNY1EB0/review";
const TARGET = "_blank";

widget.on("init", ({ widgetContainer }) => {
  const writeReviewButton = widgetContainer.querySelector(".es-header-write-review-button");
  writeReviewButton?.addEventListener("click", (e) => {
    e.stopPropagation();
    window.open(LINK, TARGET);
  });
});

In the 1st line of the code, you should add a link and in the 2nd line you choose how to open it:

  • _blank - in a new tab

  • _self - in the same tab

Note: This code works in all Reviews apps except for the All-in-One Reviews app. If you wish to implement this feature in the All-in-One Reviews app, drop us a line. Our devs will come up with a custom solution for you :slightly_smiling_face:


Guys, was this solution helpful to you? Let us know in the comments below :backhand_index_pointing_down:

2 Likes