Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #355594

    Hey 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!
    Elliott

    #355876

    The code is:

    <div itemscope itemtype=”http://schema.org/Review”&gt;
    <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”&gt;
    Written by: <span itemprop=”name”>Steve</span></div>
    <div itemprop=”itemReviewed” itemscope itemtype=”http://schema.org/Thing”&gt;
    <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”&gt;
    <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.

    #356326

    Hi!

    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.
    #356353

    Thanks 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”&gt;
    <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”&gt;
    Written by: <span itemprop=”name”>Steve</span></div>
    <div itemprop=”itemReviewed” itemscope itemtype=”http://schema.org/Thing”&gt;
    <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”&gt;
    <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>

    #356985

    Hi!

    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.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.