|
/ Knowledge Base /Products/ How to Display Product Reviews Using Shortcodes

How to Display Product Reviews Using Shortcodes

This document explains how to use SureCart product review shortcodes to display reviews on any page, including pages built with Divi, Beaver Builder, Oxygen, and other page builders that do not support the WordPress Block Editor.

Requirements

  • WordPress admin access
  • SureCart installed and activated
  • Reviews enabled on the product in SureCart
  • The Product UUID, if the shortcodes will be placed on a non-product page (see Finding the Product UUID below).

Finding the Product UUID

All shortcodes accept an optional product_id attribute, which corresponds to the SureCart product UUID. The UUID is a string of letters, numbers, and hyphens (for example, eee96da1-be2b-488d-bd76-cdb0c96b118f).

When the shortcode placement requires the UUID:

  • On product pages: The product_id attribute is optional. The shortcode automatically detects the current product.
  • On non-product pages (landing pages, custom pages, etc.): The product_id attribute is required. Without it, the shortcode renders no output.

How to Locate the Product UUID

  1. Go to WordPress Dashboard → SureCart → Products.
  2. Click the product to open the Edit Product page.
  3. Look at the browser address bar. The UUID is the value of the id parameter at the end of the URL.

Example URL: /wp-admin/admin.php?page=sc-products&action=edit&id=eee96da1-be2b-488d-bd76-cdb0c96b118f. The UUID is the value after id=.

Note: The Product UUID is not the same as the WordPress post ID. The Product UUID is assigned by SureCart and is always a string of letters, numbers, and hyphens. Using a numeric WordPress post ID with the product_id attribute does not work.

Available Shortcodes

sc_product_review_rating_stars

Displays the average rating as filled, half, or empty stars.

Basic usage: 

[sc_product_review_rating_stars]

With attributes: 

[sc_product_review_rating_stars product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" size="24px" fill_color="#f59e0b" link_to_reviews="true"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.
sizestring20pxSize of each star icon.
fill_colorstringTheme primary colorColor for filled stars (for example, #f59e0b).
link_to_reviewsbooleanfalseWraps the stars in a link to the reviews section.

sc_product_review_rating_value

Displays the average rating as a numeric value (for example, 4.5).

Basic usage: 

[sc_product_review_rating_value]

With attributes: 

[sc_product_review_rating_value product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" link_to_reviews="true"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.
link_to_reviewsbooleanfalseWraps the value in a link to the reviews section.

sc_product_review_total_count

Displays the total number of reviews (for example, 156 reviews).

Basic usage: 

[sc_product_review_total_count]

With attributes: 

[sc_product_review_total_count product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" show_label="false" link_to_reviews="false"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.
show_labelbooleantrueShows the “reviews” label next to the count. Set to false to display the number only.
show_for_zero_reviewsbooleantrueRenders output even when the product has no reviews. Set to false to hide the count when no reviews exist.
link_to_reviewsbooleantrueWraps the count in a link to the reviews section.

sc_product_review_breakdown

Displays a 5-star breakdown with progress bars showing the distribution of ratings.

Basic usage: 

[sc_product_review_breakdown]

With attributes: 

[sc_product_review_breakdown product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" columns="2" bar_fill_color="#f59e0b"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.
columnsnumber1Number of columns for the breakdown layout.
fill_colorstring—Color for the star icons in each row (for example, #f59e0b).
bar_fill_colorstring—Color for the filled portion of the progress bars (for example, #f59e0b).
bar_background_colorstring—Background color for the progress bar track (for example, #e5e7eb).

Note: fill_color controls the star icon color in each row. bar_fill_color controls the progress bar fill color. These are separate attributes. The star icon size within the breakdown rows is fixed and cannot be changed via shortcode.

sc_product_review_list

Displays the full review experience, including a summary section, filter sidebar, individual reviews with pagination, and the Write a Review form modal.

Basic usage: 

[sc_product_review_list]

With attributes: 

[sc_product_review_list product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.

The output includes the following elements:

  • Summary section — Average rating value, stars, total count, and star breakdown.
  • Filter sidebar — Star rating filter tags and checkboxes.
  • Review items — Reviewer name, verified buyer badge, date, star rating, title, and content.
  • Pagination — Previous, page numbers, and next controls.
  • Empty state — A “No reviews yet” message with a Write a Review button.
  • Write a Review button — Opens the review form modal.

This shortcode is equivalent to the full review block available in the Block Editor.

sc_product_review_add_button

Displays a Write a Review button that opens the review form modal. If the user is not logged in, the user is redirected to the customer dashboard to sign in first.

Basic usage: 

[sc_product_review_add_button]

With attributes: 

[sc_product_review_add_button product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" label="Leave a Review" button_type="text"]
AttributeTypeDefaultDescription
product_idstring—Product UUID. Required on non-product pages. Auto-detected when the shortcode is placed on a product page. See Finding the Product UUID below.
labelstringWrite a ReviewButton text label. Has no effect when button_type=”icon”.
button_typestringbothDetermines what the button displays: both (icon + text), text (text only), or icon (icon only).
iconstringedit-2Icon name displayed in the button.
classNamestringis-style-fillCSS class for button style. Use is-style-fill for a filled button or is-style-outline for an outlined button.

Examples

Display stars and rating on a landing page

[sc_product_review_rating_stars product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" size="24px"][sc_product_review_rating_value product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f"] / 5.0[sc_product_review_total_count product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f"]

Display the full review section on a custom page

[sc_product_review_list product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f"]

Display review count without label or link

[sc_product_review_total_count product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" show_label="false" link_to_reviews="false"]

Display the breakdown with custom colors

[sc_product_review_breakdown product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" columns="2" bar_fill_color="#f59e0b" bar_background_color="#e5e7eb"]

Display a standalone review button with a custom label

[sc_product_review_add_button product_id="eee96da1-be2b-488d-bd76-cdb0c96b118f" label="Leave a Review" button_type="text"]

Use shortcodes directly on a product page (no product_id required)

[sc_product_review_rating_stars][sc_product_review_breakdown][sc_product_review_list]

Notes and Limitations

  • Reviews must be enabled on the product in SureCart for any shortcode to render output.
  • The product_id attribute uses the SureCart product UUID, not the WordPress post ID. The UUID is found at the end of the Edit Product page URL.
  • These shortcodes use the WordPress Interactivity API. Interactive features such as pagination, filters, and the review form modal function without full page reloads.
  • These shortcodes override the auto-generated ones from the block registration loop, which do not set up product context correctly.
  • The star icon size within the breakdown rows is fixed and cannot be changed via shortcode attributes.

Related Documentation

FAQ

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top