Our Blog

How to Get a Star Rating Next to Your Listing on Google Search Results

Categories: 
Month Archive: January, 2025
Star rating on Google search results

How to Get a Star Rating Next to Your Listing on Google Search Results

Adding a star rating next to your listing on Google Search Results can significantly enhance your visibility and click-through rates. This is achieved using schema markup, which helps search engines understand your content better. Below, we’ll guide you on how to implement both Review Schema and Aggregate Rating Schema for your WordPress site. We’ll also provide the necessary code snippets to add to your functions.php file, including optional enhancements with your company information.

Step 1: Adding Review Schema

Review Schema allows you to showcase reviews directly in your search result snippet. Here’s a basic example of how to include three reviews, along with company information for added credibility:

Code for functions.php

add_action('wp_head', 'add_review_and_company_schema');
function add_review_and_company_schema() {
    if (is_page('your-page-slug')) { // Replace 'your-page-slug' with the actual slug of your page
        echo '<script type="application/ld+json">
        {
          "@context": "https://schema.org",
          "@type": "Review",
          "itemReviewed": {
            "@type": "Organization",
            "name": "Your Company Name", // Replace with your company name
            "url": "https://www.yourwebsite.com", // Replace with your website URL
            "logo": "https://www.yourwebsite.com/logo.png", // Replace with your logo URL
            "address": {
              "@type": "PostalAddress",
              "streetAddress": "123 Example Street", // Replace with your address
              "addressLocality": "Your City", // Replace with your city
              "addressRegion": "Your State/Region", // Replace with your state/region
              "postalCode": "12345", // Replace with your postal code
              "addressCountry": "Your Country" // Replace with your country
            },
            "contactPoint": {
              "@type": "ContactPoint",
              "telephone": "+1234567890", // Replace with your phone number
              "email": "info@yourwebsite.com" // Replace with your email
            }
          },
          "review": [
            {
              "@type": "Review",
              "author": "John Doe",
              "reviewBody": "Great service! Highly recommended.",
              "reviewRating": {
                "@type": "Rating",
                "ratingValue": "5",
                "bestRating": "5"
              }
            },
            {
              "@type": "Review",
              "author": "Jane Smith",
              "reviewBody": "Excellent quality and customer support.",
              "reviewRating": {
                "@type": "Rating",
                "ratingValue": "4.5",
                "bestRating": "5"
              }
            },
            {
              "@type": "Review",
              "author": "Chris Johnson",
              "reviewBody": "Satisfied with the overall experience.",
              "reviewRating": {
                "@type": "Rating",
                "ratingValue": "4",
                "bestRating": "5"
              }
            }
          ]
        }
        </script>';
    }
}

Step 2: Adding More Reviews

To add more reviews, simply duplicate the review block within the "review": [] array and replace the details with your reviewers’ names, review text, and ratings.

Step 3: Adding Aggregate Rating Schema

Aggregate Rating Schema is a summary of all reviews, providing an overall rating for your product or service. Here’s how to implement it:

Code for functions.php

add_action('wp_head', 'add_aggregate_rating_schema');
function add_aggregate_rating_schema() {
    if (is_page('your-page-slug')) { // Replace 'your-page-slug' with the actual slug of your page
        echo '<script type="application/ld+json">
        {
          "@context": "https://schema.org",
          "@type": "AggregateRating",
          "itemReviewed": {
            "@type": "Thing",
            "name": "Your Product or Service Name" // Replace with your product/service name
          },
          "ratingValue": "4.5", // Replace with your average rating
          "reviewCount": "3" // Replace with the number of reviews
        }
        </script>';
    }
}

Step 4: Customising the Code

  • Replace your-page-slug with the slug of the page where you want the schema to appear.
  • Edit Your Product or Service Name or Your Company Name to reflect your product or company.
  • Adjust ratingValue and reviewCount in the Aggregate Rating Schema based on your actual data.
  • Add your company’s address, telephone, email, and logo in the itemReviewed field if applicable.

Step 5: Testing Your Schema

Use Google’s Rich Results Test to verify that your schema markup is correctly implemented and eligible for star ratings in search results.

Final Thoughts

Adding star ratings and company details to your Google listing can make your website stand out. By using structured data, you provide search engines with clear, detailed information about your business, improving your website’s SEO. This can lead to higher rankings in search results, increased trust from potential customers, and ultimately, more traffic to your site. By customising and testing your schema markup, you’re taking a significant step toward making your website more competitive in today’s digital landscape.

For more insights and tips, visit our BSolve IT Blog.

Share this post

Share this post

Get official AI recognition banner showing how businesses declare clear identity signals to AI systems

Check your AI Visibility Now

Use our free AI Site Identity checker to instantly check your website’s AI signals and see exactly how visible your business is to modern AI systems.

Run the Free Checker →

We Use
Elementor Pro