Tagged: rich snippets, schema, structured data
-
AuthorPosts
-
November 21, 2014 at 2:07 pm #355128
I am trying to mark reviews on my website using structured data.
I have existing posts that have the content I want marked up so that in SERPs there are stars displayed and who has written the review and when. I have found that the schema creator from Raven Tools looks the best for my needs (http://schema-creator.org/) and when the content is put in the code generated works perfectly when tested in Google’s structured data testing tool.
When this code is put onto a post on my site and saved and I test the URL the stars and other data doesn’t show.
Do you have any idea what might be going wrong with what I am doing?
Any help would be VERY appreciated
November 21, 2014 at 9:40 pm #355594Hey hypnorich!
What is the code it gave you to use?
I found this plugin, https://wordpress.org/plugins/all-in-one-schemaorg-rich-snippets/, which may help.
Cheers!
ElliottNovember 22, 2014 at 1:37 pm #355876The code is:
<div itemscope itemtype=”http://schema.org/Review”>
<div itemprop=”name”>focused hypnosis review</div>
<div itemprop=”description”>this is a review of focused hypnosis by Steve</div>
<div itemprop=”reviewBody”>the hypnosis was great and helped me change</div>
<div itemprop=”author” itemscope itemtype=”http://schema.org/Person”>
Written by: <span itemprop=”name”>Steve</span></div>
<div itemprop=”itemReviewed” itemscope itemtype=”http://schema.org/Thing”>
<span itemprop=”name”>hypnosis</span></div>
<div><meta itemprop=”datePublished” content=”2014-11-01″>Date published: 11/01/2014</div>
<div itemprop=”reviewRating” itemscope itemtype=”http://schema.org/Rating”>
<meta itemprop=”worstRating” content=”1″><span itemprop=”ratingValue”>5</span> / <span itemprop=”bestRating”>5</span> stars</div>
</div>The page where I have put this code to test it is: https://sheffield-hypnosis.co.uk/test-review
I have looked at this plugin before and it seems good but I am ideally looking for a code based solution to the problem rather than a plugin solution as I am keen to have as few plugins as possible.
November 23, 2014 at 7:30 pm #356326Hi!
That’s weird. I would have thought this information would be added to the header with meta tags.
It looks like all of the attributes are being stripped in your source code. You linked to a post so try switching to the text editor and type it out there. If it’s a page then try using a codeblock element instead of the textblock element.
Regards,
Elliott- This reply was modified 10 years ago by Elliott.
November 23, 2014 at 9:12 pm #356353Thanks for getting back to me Elliot. I had already done exactly what you said.
It is a post I linked to and I pasted the following code into the text editor….
<div itemscope itemtype=”http://schema.org/Review”>
<div itemprop=”name”>Focused Hypnosis</div>
<div itemprop=”description”>test review</div>
<div itemprop=”reviewBody”>the hypnosis was amazing</div>
<div itemprop=”author” itemscope itemtype=”http://schema.org/Person”>
Written by: <span itemprop=”name”>Steve</span></div>
<div itemprop=”itemReviewed” itemscope itemtype=”http://schema.org/Thing”>
<span itemprop=”name”>Hypnosis for weight loss</span></div>
<div><meta itemprop=”datePublished” content=”2014-11-23″>Date published: 11/23/2014</div>
<div itemprop=”reviewRating” itemscope itemtype=”http://schema.org/Rating”>
<meta itemprop=”worstRating” content=”1″><span itemprop=”ratingValue”>5</span> / <span itemprop=”bestRating”>5</span> stars</div>
</div>I saved this and then clicked to go back into visual and went back into text editor and the code I had posted in was changed to this….
<div>
<div>Focused Hypnosis</div>
<div>test review</div>
<div>the hypnosis was amazing</div>
<div>Written by: Steve</div>
<div>Hypnosis for weight loss</div>
<div>Date published: 11/23/2014</div>
<div>5 / 5 stars</div>
</div>November 24, 2014 at 5:55 pm #356985Hi!
Ahh I see. That’s a WordPress quirk. Try adding this to the bottom of your /enfold/functions.php file.
add_filter( 'tiny_mce_before_init', 'change_mce_options' ); function change_mce_options( $init ) { $init['extended_valid_elements'] = 'div[*],meta[*],span[*]'; return $init; }
Cheers!
Elliott- This reply was modified 10 years ago by Elliott.
-
AuthorPosts
- You must be logged in to reply to this topic.