Star ratings shown on Google search results are part of the rich snippets components. To begin with, you need to ensure your product schema markup is free of any errors or conflicts with your theme. Test your markup with Google’s Rich Results testing tool. You can easily add product structured data to your product pages using themes pre-installed with it or through WooCommerce SEO plugins like Rank Math.