Show Yotpo review stars on an Elementor product template

Displaying Yotpo review stars on an Elementor product template

If your WooCommerce product pages are built with Elementor, Yotpo stars and reviews do not show: the Yotpo plugin hooks them into places in the WooCommerce product template that Elementor replaces. The fix: create two shortcodes, one for the stars and one for the reviews, and place them in your template with the Shortcode widget. Or use our plugin, which adds two ready-to-use widgets.

In short

  • Yotpo displays its widgets on hooks of the classic WooCommerce product template, which an Elementor template does not have.
  • A few lines of code in functions.php create the [wycan_yotpo_stars_rating] and [wycan_yotpo_reviews_rating] shortcodes.
  • Set the Yotpo widget location to “Manual” to avoid duplicates.
  • No code: our Yotpo Widgets for Elementor plugin.

Why the stars disappear

The Yotpo plugin for WooCommerce places the star rating in the product summary, and the reviews block at the bottom of the product page. To do so, it uses hooks of the classic WooCommerce product template. When you design your product page with the Elementor Theme Builder, that template is replaced: the hooks are no longer called, and Yotpo has nowhere left to display.

The good news: Yotpo provides the functions that display its widgets. You just need to call them where you want.

Step 1: create the shortcodes

Add this code at the end of your child theme’s functions.php file, or with the Code Snippets plugin:

add_shortcode( 'wycan_yotpo_stars_rating', function () {
    if ( ! function_exists( 'wc_yotpo_show_buttomline' ) || ! is_product() ) {
        return '';
    }
    ob_start();
    wc_yotpo_show_buttomline();
    return ob_get_clean();
} );

add_shortcode( 'wycan_yotpo_reviews_rating', function () {
    if ( ! function_exists( 'wc_yotpo_show_reviews_widget' ) || ! is_product() ) {
        return '';
    }
    ob_start();
    wc_yotpo_show_reviews_widget();
    return ob_get_clean();
} );

The first shortcode displays the stars and the number of reviews, the second the full reviews block. Yotpo’s functions output their content directly: ob_start() captures it so the shortcode returns it, as WordPress expects. It then displays exactly where the widget sits.

Step 2: place the widgets in the Elementor template

  1. Open your Single Product template in Elementor.
  2. Drag a Shortcode widget under the product title and enter [wycan_yotpo_stars_rating].
  3. Drag a second Shortcode widget further down, for example under the description, with [wycan_yotpo_reviews_rating].
  4. Save and view a product page.
Elementor product page showing the Yotpo five-star rating and the number of reviews below the title
Yotpo stars and the number of reviews, under the title of an Elementor product page.

Step 3: set the location in Yotpo

In the Yotpo plugin settings, the Select v3 widget location option is set to “Automatic” by default. If your Elementor template keeps some WooCommerce hooks, the widgets could then appear twice. Set it to “Manual”: only your shortcodes will display the reviews.

With Yotpo v3 widgets, also check that the IDs of the reviews widget and the stars widget are filled in the settings: without them, the stars do not show.

See the original code on our GitHub

No code: our plugin

If you would rather not touch the code, we built Yotpo Widgets for Elementor. It adds two widgets, Yotpo Stars and Yotpo Reviews, to drag into your template and style from Elementor. A third widget shows the rating of a specific product on any page.

Watch the method on YouTube

A plugin that refuses to show in your Elementor template? That is exactly the kind of problem we fix. Let’s talk.

Contents
Read next

More articles that may help you

Illustration au trait : un casque audio, une onde sonore, un stockage de fichiers et le symbole d’un flux RSS

Self-hosted podcast: moving a podcast to WordPress and Cloudflare R2

Read the article →
Illustration au trait : une patinoire vue de dessus, des sapins et un écran d’état avec deux pastilles

Ice rink and skating trail: a municipality’s custom WordPress plugin

Read the article →
WooCommerce e-invoicing: how to make your shop compliant

WooCommerce e-invoicing: how to bring your shop into compliance

Read the article →

A project, a question?

Free quote · Refundable deposit · Balance only if satisfied · No commitment