Yoast vs Snippets extension

Hey folks,

I am trying to decide if I should use the Yoast SEO plugin for rich snippets or the Snippets extension provided by themeco.

Is one more extensive than the other? If it helps, I run an ecommerce website with WooCommerce.

Thank you

Hello There,

Thanks for writing in!

I would recommend you to use Themeco Snippet extension as it offers more flexibility. You can refer our knowledge base article to get started:

Thanks.

Hi Prasant,

Thanks for your reply!

I have gone ahead and setup the Snippets extension, but I am getting a few errors when testing products with Googles Structured Data Testing Tool - https://search.google.com/structured-data/testing-tool

The error is in regards to product reviews. The testing tool lists this error for each review - “The review has no reviewed item specified”.

You can see the test results here - https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Fguitarsauce.com.au%2Fshop%2Fles-paul-wiring-harness-kit-upgrade%2F

Thanks for your help!

Hello There,

Thank you for updating in! To resolve this issue, since the child theme is set up, please add the following code in your child theme’s functions.php file

if ( ! function_exists( 'x_renew_comment' ) ) :
  function x_renew_comment( $comment, $args, $depth ) {

    $GLOBALS['comment'] = $comment;
    switch ( $comment->comment_type ) :
      case 'pingback' :  // 1
      case 'trackback' : // 1
    ?>
    <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
      <p><?php _e( 'Pingback:', '__x__' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', '__x__' ), '<span class="edit-link">', '</span>' ); ?></p>
    <?php
        break;
      default : // 2
      GLOBAL $post;
      if ( X_WOOCOMMERCE_IS_ACTIVE ) :
        $rating = esc_attr( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) );
      endif;
      if ( x_is_product() ) {
        $comment_avatar = get_avatar( $comment, 240 );
      } else {
        $comment_avatar = get_avatar( $comment, 120 );
      }
    ?>
    <li id="li-comment-<?php comment_ID(); ?>"  <?php comment_class(); ?>>
      <article id="comment-<?php comment_ID(); ?>" class="comment">
        <?php
        printf( '<div class="x-comment-img">%s</div>',
          '<span class="avatar-wrap cf">' . $comment_avatar . '</span>'
        );
        ?>
        <?php if ( ! x_is_product() ) : ?>
        <div class="x-reply">
          <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon="&#xf112;"></i></span>', '__x__' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
        </div>
        <?php endif; ?>
        <div class="x-comment-wrap">
          <header class="x-comment-header">
            <?php
            printf( '<cite class="x-comment-author" itemprop="author">%1$s</cite>',
              get_comment_author_link()
            );
            if ( x_is_product() && get_option('woocommerce_enable_review_rating') == 'yes' ) : ?>
              <div class="star-rating-container">
                <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo sprintf( __( 'Rated %d out of 5', '__x__' ), $rating ) ?>">
                  <span style="width:<?php echo ( intval( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ) / 5 ) * 100; ?>%"><strong itemprop="ratingValue"><?php echo intval( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ); ?></strong> <?php _e( 'out of 5', '__x__' ); ?></span>
                </div>
              </div>
            <?php endif;
            printf( '<div><a href="%1$s" class="x-comment-time"><time itemprop="datePublished" datetime="%2$s">%3$s</time></a></div>',
              esc_url( get_comment_link( $comment->comment_ID ) ),
              get_comment_time( 'c' ),
              sprintf( __( '%1$s at %2$s', '__x__' ),
                get_comment_date( 'm.d.Y' ),
                get_comment_time()
              )
            );
            edit_comment_link( __( '<i class="x-icon-edit" data-x-icon="&#xf044;"></i> Edit', '__x__' ) );
            ?>
          </header>
          <?php if ( '0' == $comment->comment_approved ) : ?>
            <p class="x-comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', '__x__' ); ?></p>
          <?php endif; ?>
          <section class="x-comment-content" itemprop="description">
            <?php comment_text(); ?>
          </section>
        </div>
      </article>
    <?php
        break;
    endswitch;

  }
endif;

We would loved to know if this has work for you. Thank you.

Hi RueNel,

Thank you very much! Just tested and no more review errors :slight_smile: I really appreciate you supplying that code.

I am still getting a couple of other errors and I am not sure if I should start new topics for them or ask them all here? I will list them below but please let me know if they should be in separate topics

  1. What schema should be used for regular pages (home page, “about us” etc). Should schemas be disabled for these pages? I currently have them set to “article”.

  2. I have my organization type set to “music store”. But I think this may be incorrect for my circumstances. I do not have a physical shop front as my business operates as an online store only. Is there a better option? Hard to find a solid answer to this one…

  3. Following on from the above question, in the Structured Data Testing Tool, “music store” is showing 3 errors for “address”, “priceRange” and “telephone”. I have an address and telephone number so not sure why it is throwing an error. As for price range, I can’t see where to enter this.

  4. Editing schema for each product - It is asking for a price here, but my product prices vary based on variations selected. Should I just enter the “base” price?

  5. Editing schema for each product - There is a text field “URI for the offer (to buy)”. What needs to be entered here? I’m assuming the products URL?

Apologies for all the questions, and thank you for any help you can offer.

Hi there,

  1. You may and you may not disable them. But personally, I’d enable them for pages as they may also contain information needed by your site. And yes, the article is okay too, but it may require further meta data that pages don’t have, like author and dates.

  2. You may try the generic store, though, I don’t think physical store matters. But in the address, you have to input your organization or your personal address (it doesn’t have to be your actual store address).

  3. As for the warning, the address and telephone are correctly added and even displayed from the result. You may ignore it for now, and we’re still looking into it too :slight_smile:

  4. Are you referring to offer section? You may ignore it at least you wish to offer different price and discount for that product.

  5. It’s the offer URL, example, you can add a product link with the coupon and when a user visited, it will then automatically apply the price/discount. You may ignore the offer section since it’s not always needed.

Thanks!

@iam thank you for your help! :slight_smile:

Glad to see we managed to help!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.