Tagged: BlogPosting, ImageObject, structured data, yigit
-
AuthorPosts
-
February 17, 2018 at 10:53 am #913605
Good morning,
I’ve tested my site on google and I received errors in structured data. https://search.google.com/structured-data/testing-tool?hl=nl
8 errors in Blogposting:
Google herkent de property ImageObject niet voor een object van het type BlogPosting.
6 errors in Webpage:
Google herkent de property ImageObject niet voor een object van het type WebPage.
Its about: <span class=’av-structured-data’ itemprop=”ImageObject” itemscope=”itemscope” itemtype=”https://schema.org/ImageObject” itemprop=’image’>How to solve this problem?
Thank you, regards!
February 18, 2018 at 9:07 pm #914007Hey Dutchman,
If you want to change the structure data, from what we provide from Enfold, we would need you to modify the template files based on your needs.
That said, you would need to go, take the theme files, move to to a child theme and then use them as you want.Best regards,
BasilisFebruary 20, 2018 at 11:01 pm #915105Hey Basilis,
I added an image to a blog with the help of:
[av_image src=’https://www. [/av_image]
This results in errors the structured data test tool is giving me. So it’s nothing more then a blog with a couple of images.
I would like a blog with an image without errors in the structured data testing tool.February 21, 2018 at 6:23 am #915290Hi,
Thank you for the update.
Please add this code in the functions.php file.
add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2); function avf_markup_helper_attributes_modified($attributes, $args) { if($args['context'] == 'image') { unset($attributes['itemscope']); unset($attributes['itemtype'); } return $attributes; }
It will unset the image object.
Best regards,
IsmaelFebruary 23, 2018 at 7:51 pm #916809Hi Ismael,
Why does a default blog page with a simple image gives an error at the structured data testing tool? Is it wrong to use [av_image src=’https://www. [/av_image] in a blog?
So everybody need to put this code into functions.php if they want to avoid these errors?Edit: I allready have to put this in functions.php:
add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2); function avf_markup_helper_attributes_modified($attributes, $args) { if($args['context'] == 'entry') { //* If main query, if ( is_main_query() ) unset($attributes['itemprop']); } if($args['context'] == 'content') { if (is_singular('post') || is_archive() || is_home()) { $attributes['itemprop'] = 'mainEntity'; } } return $attributes; }
- This reply was modified 6 years, 10 months ago by Dutchman.
February 26, 2018 at 3:54 am #917645Hi,
Why does a default blog page with a simple image gives an error at the structured data testing tool?
The ImageObject is not a valid property of the BlogPosting object, which is why the tool is returning the errors. Please replace and combine the previous filters with this.
add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2); function avf_markup_helper_attributes_modified($attributes, $args) { if($args['context'] == 'image') { $attributes['itemscope'] = 'itemscope'; $attributes['itemtype'] = 'https://schema.org/image'; $attributes['itemprop'] = 'image'; } if($args['context'] == 'entry') { //* If main query, if ( is_main_query() ) unset($attributes['itemprop']); } if($args['context'] == 'content') { if (is_singular('post') || is_archive() || is_home()) { $attributes['itemprop'] = 'mainEntity'; } } return $attributes; }
It’s going to replace the “ImageObject” with the “image” property.
Best regards,
IsmaelFebruary 26, 2018 at 8:33 pm #917967Hi Ismael,
After i replaced the code with your combination code i get more errors:
Google herkent de property ImageObject niet voor een object van het type BlogPosting.
cancel@type
image (Google herkent het type image niet.) (Google does’t recognise image.I still do not understand why Google testing tool gives us these errors in a default blog page from Enfold. Errors for blogposting and ImageObject.
Even your default demo has these errors: https://kriesi.at/themes/enfold-2017/blog/blog-single-author-big/+ I added 1 other example with a different error. On the second page i “use av-masonry-image-container” and that results in ”
Google herkent de property ImageObject niet voor een object van het type WebPage.”February 28, 2018 at 8:37 am #918852Hi,
Did you refresh the page before the structure test? I want to check it myself but I can’t access the structured data testing tool today. Odd.
Best regards,
IsmaelMarch 3, 2018 at 11:25 am #920736Hi, I refreshed and cleared the cache but that did not help.
March 6, 2018 at 4:36 am #922014Hi,
The type is still set to “ImageObject” instead of “image”. I don’t think the filter was added correctly. Please provide the login details in the private field so that we can check it.
Best regards,
IsmaelMarch 7, 2018 at 8:57 am #922791Hi Ismael, i copied excactly what you told me to and replaced my code with your code but since it created more errors in the structured data testing tool, i put the old code back in functions.php.
I replaced it with your code and like i said more errors:
Google herkent de property ImageObject niet voor een object van het type BlogPosting.
cancel@type
image (Google herkent het type image niet.)March 9, 2018 at 1:59 am #924210Hi,
Thank you for the update. Did you copy the code from your email? Please copy it directly from this forum. Or provide the login details so that we can add the new filter.
Best regards,
IsmaelMarch 9, 2018 at 8:44 am #924344Hi,
I did copied it from this forum. I provided the login details.March 9, 2018 at 10:43 am #924384Hi,
Thank you for the info. I’m getting an error in the Appearance > Editor panel. Please provide the FTP login details.
Er is iets fout gegaan. Uw wijziging is mogelijk niet opgeslagen. Probeer opnieuw. Er is een kans dat u dit handmatig moet repareren en het bestand uploaden via FTP.
The itemprop attribute is missing in the filter. We updated the code above.
// https://kriesi.at/support/topic/error-in-structured-data-3/#post-917645
Best regards,
IsmaelMarch 9, 2018 at 11:49 am #924422The problem is still there. I replaced it with the ‘new’ code but there are still 14 errors.
- This reply was modified 6 years, 9 months ago by Dutchman.
March 14, 2018 at 7:30 am #926448Hi,
In the data structure testing tool field, I changed the itemprop and itemtype attributes to “image” and it worked. The errors are gone. The filter should do the same. Please provide the FTP details in the private field so that we can test it.
Best regards,
IsmaelMarch 14, 2018 at 10:03 pm #926870Hi,
Details are in the private sectionMarch 15, 2018 at 6:35 am #927070March 15, 2018 at 8:47 am #927133Hi Ismael,
I reinstalled the theme through FTP but @ Appearance >> Editor Panel i still get the same error when i try to save the functions.php.
These are the FTP login details.March 16, 2018 at 5:02 am #927887Hi,
I’m sorry but this is still not working on FileZilla. I’ll ask the rest of the support team to check the thread.
Best regards,
IsmaelMarch 16, 2018 at 8:39 am #927970Hi!
The function has been added to your site via FTP. Please review the site and let us know if you have any questions.Please wait while we update you!
In the meantime could you please provide us with your hosting control panel details, please?
Thank you for using Enfold.
Regards,
Vinay- This reply was modified 6 years, 9 months ago by Vinay.
March 16, 2018 at 8:13 pm #928250Hi Ismael,
I found the plugin that blocked the functions.php from editing through Appearance, Editor panel. You can login and edit the functions.php please. The code you gave me is at the very bottom.
- This reply was modified 6 years, 9 months ago by Dutchman.
March 19, 2018 at 3:45 am #928848Hi,
The site is not loading properly on my end. Did you do anything to the site?
Best regards,
IsmaelMarch 19, 2018 at 8:45 am #928918Hi, can you try again please. The site works fine.
March 20, 2018 at 11:36 am #929737Hi,
We replaced the filter with the following code.
add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2); function avf_markup_helper_attributes_modified($attributes, $args) { if($args['context'] == 'image') { unset($attributes['itemscope']); unset($attributes['itemtype']); unset($attributes['itemprop']); } if($args['context'] == 'entry') { //* If main query, if ( is_main_query() ) unset($attributes['itemprop']); } if($args['context'] == 'content') { if (is_singular('post') || is_archive() || is_home()) { $attributes['itemprop'] = 'mainEntity'; } } return $attributes; }
Best regards,
IsmaelMarch 22, 2018 at 8:47 am #931098Now there are 2 new errors about the size of the image in the Structured data testing tool.
“1200 (Google herkent de property height niet voor een object van het type BlogPosting.)”
“2560 (Google herkent de property width niet voor een object van het type BlogPosting.)”I still do not understand why Google testing tool gives us these errors in a default blog page from Enfold.
Even your default demo has these (12) errors! https://kriesi.at/themes/enfold-2017/blog/blog-single-author-big/
Is this something you should change in the default installation files? Looks like a bug to me.March 26, 2018 at 5:11 am #932780Hi,
I’m sorry for the late response. Please modify the includes > loop-index.php file, look for the “av_blog_entry_markup_helper” function on line 290. Add the ‘image’ in the array.
echo av_blog_entry_markup_helper($current_post['the_id'], array('image'));
Which plugin causes the issue with the Appearance > Editor panel? Please disable it temporarily so that we can edit the file.
Best regards,
IsmaelApril 1, 2018 at 9:38 pm #935831Hi Ismael,
Its the Universal Video Player. I disabled it. And i replaced line 290 with yours. The Google structured data testing tool show an error. The homepage shows warnings about the height and width. I was hoping for a clean working solution. Maybe Kriesi or another mod has a structured solution for this issue.- This reply was modified 6 years, 8 months ago by Dutchman.
April 3, 2018 at 2:40 am #936257Hi,
I’ll ask the rest of the support team to check the thread. They will probably suggest the same things.
Best regards,
IsmaelApril 12, 2018 at 7:18 am #940796Maybe Yigit has a solution for this issue to get rid of all the errors.
I still do not understand why Google testing tool gives us these errors in a default blog page from Enfold.
Even your default demo has these (12) errors! https://kriesi.at/themes/enfold-2017/blog/blog-single-author-big/
Is this something you should change in the default installation files? Looks like a bug to me. -
AuthorPosts
- You must be logged in to reply to this topic.