Rankmath inserting snippet into post?

#19643
  • Resolved Stella Fosse
    Rank Math pro

    I am having an issue in new posts that postdates installation of RankMat and seems to be related. I have a CPT post type and use it for reviews on the site. On recent posts such as this:

    https://stellafosse.com/book/all-we-know-of-pleasure/

    It seems to be from this code on the page (NB I am NOT a coder and can’t make sense of this):

    /*!
    * Plugin: Rank Math
    * URL: https://rankmath.com/wordpress/plugin/seo-suite/
    * Name: rank-math-review-snippet.css
    */#rank-math-rich-snippet-wrapper {
    overflow:hidden
    }

    #rank-math-rich-snippet-wrapper h5.rank-math-title {
    display: block;
    padding: 0;
    background: transparent;
    letter-spacing: 1px;
    text-transform: none;
    border: 0;
    font-weight: bold;
    color: #111111;
    font-size: 18px;
    line-height:1.4
    }

    #rank-math-rich-snippet-wrapper .rank-math-review-image {
    float: right;
    max-width: 40%;
    margin-left:15px
    }

    #rank-math-rich-snippet-wrapper .rank-math-review-data {
    color: #111111;
    margin-bottom:15px
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper {
    width: 100%;
    padding: 0 0 20px 0;
    float: left;
    clear: both;
    position: relative;
    box-sizing:border-box
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-total {
    border: 0;
    display: block;
    margin: 0;
    width: auto;
    float: left;
    text-align: left;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    box-sizing: border-box;
    overflow:hidden
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star {
    float: left;
    margin-left: 15px;
    position: relative;
    z-index: 99;
    line-height:1
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star .rank-math-review-result-wrapper {
    display: inline-block;
    white-space: nowrap;
    position: relative;
    color:#f4f4f4
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star .rank-math-review-result-wrapper .rank-math-review-result {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color:#ffbe01
    }

    #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star .rank-math-review-result-wrapper i {
    font-size: 18px;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: #997200;
    font-style: normal;
    padding: 0 2px;
    line-height:inherit
    }

    body.rtl #rank-math-rich-snippet-wrapper .rank-math-review-image {
    float: left;
    margin-left: 0;
    margin-right:15px
    }

    body.rtl #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-total {
    float:right
    }

    body.rtl #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star {
    float: right;
    margin-left: 0;
    margin-right:15px
    }

    body.rtl #rank-math-rich-snippet-wrapper .rank-math-total-wrapper .rank-math-review-star .rank-math-review-result {
    left: auto;
    right:0
    }


    @media
    screen and (max-width: 480px) {
    #rank-math-rich-snippet-wrapper .rank-math-review-image {
    display: block;
    max-width: 100%;
    width: 100%;
    text-align: center;
    margin-right:0
    }

    #rank-math-rich-snippet-wrapper .rank-math-review-data {
    clear:both
    }
    }

    .clear {
    clear: both
    }

    I need to find out how to prevent this form happening.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    The preview of your review is added in accordance with the Google guidelines which suggest that a webmaster should show the schema to the users as well as to the bots.

    If you show it to just the bots, you run the risk of getting removed from the rich snippets program. That is the reason it is being added to the frontend.

    Although we do not recommend removing it from the frontend – Rank Math allows you to take full control of your SEO. You can follow this link to remove the Review Display from the frontend.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    I’m not sure that I understand. I should reiterate that I’m NOT a developer, just using Elementor and WP for a modest web site.

    Did you check the link: https://stellafosse.com/book/all-we-know-of-pleasure/ ??

    I find it difficult to believe that this is intended behavior – not only does it look nonsensical, it doesn’t happen on most pages, only this added after we switched to RankMath – even though the older posts are also setup with RankMath.

    Is this really how the page SHOULD display?

    Thanks

    Hi Stella,

    Thanks for the response.

    This is what Google expects but I agree that the interaction of the styles on the page looks a bit weird. To fix this, please head over to Appearance > Theme editor and add the following code to your theme’s functions.php file:

    /**
     * Filter: Allow disabling the review display.
     *
     * @param bool $return true to disable.
     */
    add_filter( 'rank_math/snippet/review/hide_data', '__return_true' );

    If you have any problems with adding this code, please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    I’ll try that. Thanks for the ‘how’, I was pondering that!

    Cheers

    That appears to have cracked it.

    Your help is much appreciated.

    Cheers

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The ticket ‘Rankmath inserting snippet into post?’ is closed to new replies.