Blog · Gutenberg

Star Rating block for WordPress

Static visual star rating (1–5 stars) with optional label and numeric score. CSS-only, perfect inside testimonial cards.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Static visual star rating (1–5 stars) with optional label and numeric score. CSS-only, perfect inside testimonial cards.

Inspector panels on this block: Stars, Layout. Those titles come from index.js, not from a shared template.

Behavior controls: “Shape” options: Star, Heart, Diamond, Thumbs Up, Circle; “Layout — Alignment” options: Left, Center, Right; “Label Position” options: Below stars, Above stars, Left of stars, Right of stars; “Numeric Template” (Use {rating} and {max} as placeholders).

Star Rating has no render.php and no frontend.js. The saved Gutenberg HTML is what visitors see, plus Blockenberg layout/typography CSS.

Where to find it

Gutenberg inserter → Blog → search “Star Rating” (block name `blockenberg/star-rating` in block.json). Style it in the sidebar after insert.

How to use Star Rating block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Star Rating”, insert it. Category: Blog.
  3. Configure inspector controls that exist on this block. Open Stars. Set “Rating”, “Max Stars”, “Shape”, “Size (px)”.
  4. Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.

Inspector controls from this block’s code

ControlWhat the code does
RatingNumeric range control in the inspector. block.json default: 4. Saved as `rating`.
Max StarsNumeric range control in the inspector. Range 1–10. block.json default: 5. Saved as `maxStars`.
ShapeSelect control; the chosen value is saved on the block. Options: Star; Heart; Diamond; Thumbs Up; Circle. block.json default: star. Saved as `starShape`.
Size (px)Numeric range control in the inspector. Range 12–80. block.json default: 28. Saved as `starSize`.
Gap between stars (px)Numeric range control in the inspector. Range 0–24. block.json default: 3. Saved as `starGap`.
Layout — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `textAlign`.
Show LabelOn/off toggle in the inspector. On by default. Saved as `showLabel`.
Label PositionSelect control; the chosen value is saved on the block. Options: Below stars; Above stars; Left of stars; Right of stars. block.json default: below. Saved as `labelPosition`.
Show Numeric ScoreOn/off toggle in the inspector. Off by default. Saved as `showNumeric`.
Numeric TemplateText field in the inspector. Use {rating} and {max} as placeholders. block.json default: {rating} out of {max}. Saved as `numericTemplate`.
Label spacing from starsNumeric range control in the inspector. Range 0–40. block.json default: 8. Saved as `labelSpacing`.
Numeric spacing from starsNumeric range control in the inspector. Range 0–40. block.json default: 6. Saved as `numericSpacing`.

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Star Rating block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Star Rating”. It sits under Blog. After insert, open Stars and set “Rating”, “Max Stars”, “Shape”, “Size (px)”.

What makes Star Rating different from other Blockenberg blocks?

Static visual star rating (1–5 stars) with optional label and numeric score. CSS-only, perfect inside testimonial cards. Inspector labels on this block include “Rating”, “Max Stars”, “Shape”, “Size (px)”.

Is the Star Rating Gutenberg block free?

Yes. Star Rating ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Star Rating to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Stars, Layout).

Related blog blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Star Rating from the Gutenberg inserter.

Get Blockenberg