Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor dudo

    (@dudo)

    Hello cmw85, thank you for using Yasr!

    It’s not possible in the yasr settings, but it’s possible with a little edit in the code (but you need to do this everytime you update the plugin)

    Is it ok for you?

    Best,
    Dario

    Thread Starter cmw85

    (@cmw85)

    Hi Dario, thank you for such a great plugin and your quick reply!

    Yes, editing a bit of the code works for me.

    Thanks again for the help,

    Chris

    Plugin Contributor dudo

    (@dudo)

    In the plugin dir, open file /lib/yasr-functions.php and on line 367 change this

    $schema = $div . $title . $author . $date . $rating . $end_div;
     if ($review_choosen == "Other") {
        $schema = $div . $title . $date . $author . $rating . $end_div;
     }

    with this

    $schema = $div . $title . $author . $rating . $end_div;
     if ($review_choosen == "Other") {
        $schema = $div . $title .  $author . $rating . $end_div;
     }

    and on line 434 change this

    $schema = $div_1 . $author . $date . $span_1 . $rating . $n_ratings . $end_span_1 . $end_div_1;

    with this

    $schema = $div_1 . $author . $span_1 . $rating . $n_ratings . $end_span_1 . $end_div_1;

    Thread Starter cmw85

    (@cmw85)

    Hi,

    Thanks again for the quick reply.

    So I changed the code you mentioned, and also changed a couple of things with a few of my posts’ meta descriptions. Then I did a Google fetch for the posts and noticed that my meta description changes went through successfully, but the date is still appearing to the right of “Review by (my name)” in the meta descriptions in Google search results.

    Is there any other code I need to change to get these dates removed?

    Plugin Contributor dudo

    (@dudo)

    If you did that changes it could be the theme to insert the date. If you can give me a link to your site I can give a better help 😉

    Thread Starter cmw85

    (@cmw85)

    Sure, my site is http://www.sapphirereviews.com

    But I talked to the support staff for my theme and they told me to remove a line of code from single.php. After I removed that code one of the dates from the beginning of my meta description was removed, but the date beside the star rating and review author still shows up.

    Plugin Contributor dudo

    (@dudo)

    Ah, I see you’re using json-ld instead of microdata.

    open the same file as before and on line 500 change this

    "datePublished" => "$date",

    with this

    //"datePublished" => "$date",

    Thread Starter cmw85

    (@cmw85)

    Hey, so I made the change you just mentioned and the date disappeared from beside the star rating in search results. =)

    But now the date is appearing at the start of the meta description again (and as mentioned, I’ve removed the date from the actual posts in the single.php file)

    Any suggestions for how to get this lingering date to go away for good?

    Thanks for all your help so far, I really appreciate it.

    Plugin Contributor dudo

    (@dudo)

    It is not because of yasr, I just take a look to the code of your page and the only date I see are these:

    <meta property="article:published_time" content="2016-01-20T22:48:28+00:00" />
    <meta property="article:modified_time" content="2016-01-28T18:56:20+00:00" />
    <meta property="og:updated_time" content="2016-01-28T18:56:20+00:00" />

    that are printed buy Yoast SEO plugin.

    Another date are bottom:

    <meta itemprop="datePublished" datetime="2016-01-20">

    and this one is printed by product review plugin

    Best,
    Dario

    Thread Starter cmw85

    (@cmw85)

    Oh it’s working now.

    I also changed: $date = get_the_date(‘c’);

    to: //$date = get_the_date(‘c’);

    and did a fetch for one of my reviews on my other site that uses same theme, and it’s showing up perfectly in Google (not sure if my change made a difference or whether it was just coincidence)

    But thanks a bunch for your help! Issue resolved.

    Thread Starter cmw85

    (@cmw85)

    Hey Dario,

    Just one more question: When I do a google search for “site:sapphirereviews.com” the star ratings show up in the search results for my reviews.

    But when I do a non “site:” search for my pages, the star ratings do not show up.

    Could this be because I’m using json-ld instead of microdata?

    Or do I just need to give Google some time to figure out that they should show my star ratings in their search results?

    Plugin Contributor dudo

    (@dudo)

    google here https://developers.google.com/structured-data/rich-snippets/reviews saya that json-ld has to be implemented yet for reviews. So I suggest to use microdata

    Thread Starter cmw85

    (@cmw85)

    Ok, I switched to microdata and did a few Google fetches, but now some of my reviews aren’t showing the star ratings at all when I do “site:(domain)” searches.

    In the yasr-functions.php file I’ve switched back to just the first changes you told me to do, and reverted the rest of the changes I made. Should this fix the issue for still not showing the date, and also show the star ratings in search results?

    Plugin Contributor dudo

    (@dudo)

    Of course, google need some time to update the serp, in some cases it require just a few of hours, in other can require up to two months (or more)

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Remove date from meta description in search results?’ is closed to new replies.