By Giulia Magnesa on Tuesday, 31 July 2018
Posted in General Issues
Likes 0
Views 2.6K
Votes 0
Hi
we are encontering a problem in Google search:
if we look for "PcVue Solutions iot blog" the first article in the list appear with low rating even if there is no rating vote for this article.

It seems to be caused by to have not implemented schema.org structured data in the code and in this case the code that affects this issue is following:

<div class="eb-entry-ratings">
<div class="eb-rating">
<form id="blog-131-ratings-form"
class="eb-rating-form"
data-locked="1"
data-id="131"
data-type="entry"
data-rating-form
data-score="0"
data-rtl="0"
>

<div data-rating-form-element></div>

<div class="col-cell eb-rating-voters">
<a class="eb-rating-link" href="javascript:void(0);" data-rating-voters>

<b class="eb-ratings-value" title="0 votes" data-rating-value>
<span data-rating-total>0</span>

<b title="You have already rated this entry">
<i class="fa fa-check"></i>
</b>
</b>

</a>
</div>
</form>
</div> </div>


I have looked for a simmple component that could help to implement structured shema.org data in the html code: https://extensions.joomla.org/extension/google-structured-data-markup/
What do you think?
Could you suggest thid component or similar?

Thank you
Giulia
Hey Giulia,

With the latest version of EasyBlog, we emphasize a lot on Structured Data which helps optimize your site's search ranking. If you do not want to display the ratings, you can edit the file /components/com_easyblog/themes/wireframe/blogs/entry/default.posts.php and locate the codes below:

[gist]
<script type="application/ld+json">
{
"@context": "http://schema.org",
"mainEntityOfPage": "<?php echo $post->getPermalink(true, true); ?>",
"@type": "BlogPosting",
"headline": "<?php echo $post->getTitle();?>",
"image": "<?php echo $post->getImage($this->config->get('cover_size_entry', 'large'), true, true);?>",
"editor": "<?php echo $post->getAuthor()->getName();?>",
"genre": "<?php echo $post->getPrimaryCategory()->title;?>",
"wordcount": "<?php echo $post->getTotalWords();?>",
"publisher": {
"@type": "Organization",
"name": "<?php echo EB::showSiteName(); ?>",
"logo": <?php echo $post->getSchemaLogo(); ?>
},
"datePublished": "<?php echo $post->getPublishDate(true)->format('Y-m-d');?>",
"dateCreated": "<?php echo $post->getCreationDate(true)->format('Y-m-d');?>",
"dateModified": "<?php echo $post->getModifiedDate()->format('Y-m-d');?>",
"description": "<?php echo EB::jconfig()->get('MetaDesc'); ?>",
"articleBody": "<?php echo htmlentities($content, ENT_QUOTES);?>",
"author": {
"@type": "Person",
"name": "<?php echo $post->getAuthor()->getName();?>",
"image": "<?php echo $post->creator->getAvatar();?>"
},
<?php if (!$preview && $this->config->get('main_ratings') && $this->entryParams->get('post_ratings', true)) { ?>
"aggregateRating": {
"@type": "http://schema.org/AggregateRating",
"ratingValue": "<?php echo $ratings->total ? round($ratings->ratings / 2, 2) : 1; ?>",
"worstRating": "1",
"bestRating": "5",
"ratingCount": "<?php echo $ratings->total ? $ratings->total : 1; ?>"
}
<?php } ?>
}
</script>
[/gist]

Replace it with,

[gist]
<script type="application/ld+json">
{
"@context": "http://schema.org",
"mainEntityOfPage": "<?php echo $post->getPermalink(true, true); ?>",
"@type": "BlogPosting",
"headline": "<?php echo $post->getTitle();?>",
"image": "<?php echo $post->getImage($this->config->get('cover_size_entry', 'large'), true, true);?>",
"editor": "<?php echo $post->getAuthor()->getName();?>",
"genre": "<?php echo $post->getPrimaryCategory()->title;?>",
"wordcount": "<?php echo $post->getTotalWords();?>",
"publisher": {
"@type": "Organization",
"name": "<?php echo EB::showSiteName(); ?>",
"logo": <?php echo $post->getSchemaLogo(); ?>
},
"datePublished": "<?php echo $post->getPublishDate(true)->format('Y-m-d');?>",
"dateCreated": "<?php echo $post->getCreationDate(true)->format('Y-m-d');?>",
"dateModified": "<?php echo $post->getModifiedDate()->format('Y-m-d');?>",
"description": "<?php echo EB::jconfig()->get('MetaDesc'); ?>",
"articleBody": "<?php echo htmlentities($content, ENT_QUOTES);?>",
"author": {
"@type": "Person",
"name": "<?php echo $post->getAuthor()->getName();?>",
"image": "<?php echo $post->creator->getAvatar();?>"
}
}
</script>
[/gist]
·
Wednesday, 01 August 2018 00:13
·
0 Likes
·
0 Votes
·
0 Comments
·
By the way, you can easily test structured data here, https://search.google.com/structured-data/testing-tool
·
Wednesday, 01 August 2018 00:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi
First of all I have just updated EasyBlog to last version, also I have substituted the code as you unducated but it doesn't work as the rankung appears in the Search list (see the enclosed image).

Any other suggestion?
How can I solve this issue?
·
Wednesday, 01 August 2018 14:51
·
0 Likes
·
0 Votes
·
0 Comments
·
If i recall correctly, Google need to re-crawl on your site blog post page then only will update the latest data.

As long as you removed those 'aggregateRating' code from this php file, you have to wait for Google index to your page again then it will only can update it on their search page.

Based on what i checked this page, Google already crawled this blog post page on 25 Jul 2018 15:50:14 GMT, you can check my attached screenshot below.

The best way to keep track of how frequently Google visits your website, is to examine your crawl stats in Google Webmaster Tools.
·
Wednesday, 01 August 2018 15:55
·
0 Likes
·
0 Votes
·
0 Comments
·
ok so I should wait for a Re-crawl

Anyway, what happens when I will update EasyBlog component?
Will I loose the custom code you suggested before?
·
Wednesday, 01 August 2018 16:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, you have to wait for Google to re-crawl your site again or you can manually re-submit your sitemap file to Google.

You can read more this link : https://support.google.com/webmasters/answer/183668?hl=en

Regarding with your second question, it would be best if you can copy this file default.posts.php then override into your current template folder e.g. JoomlaFolder/templates/YourCurrentTemplate/html/com_easyblog/blogs/entry/default.posts.php

So in this way, you do not need to re-do again for this customisation part.
·
Wednesday, 01 August 2018 17:13
·
0 Likes
·
0 Votes
·
0 Comments
·
ok thank you
·
Wednesday, 01 August 2018 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
You're most welcome.
·
Wednesday, 01 August 2018 18:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello! I have the last version of easyblog and I have schema logo error:


https://www.schumanassociates.com/images/easyblog_articles/362/b2ap3_thumbnail_Horizon-Europe-post-2020_header.jpg",
"editor": "Schuman Associates",
"genre": "News",
"wordcount": "236",
"publisher": {
"@type": "Organization",
"name": "Schuman Associates",
"logo": },
"datePublished": "2020-11-05",
"dateCreated": "2020-11-05",
"dateModified": "2020-11-05",
"description": "",
·
Thursday, 28 September 2023 16:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post