EDD Duplicated Schema problem

#711331
  • Resolved Ali Kavyani
    Rank Math free

    Hi rankmath team,
    thank’s for your great product.
    We encountered a strange problem on a website.
    In this website, Rankmath and EDD are used with the Iranian RIAL currency.

    then added this code to rank-math.php in child theme to fix the problem(kkstar used as aggregateRating):
    add_filter( “rank_math/snippet/rich_snippet_product_entity”, “custom_kksr_rating”);

    function custom_kksr_rating ( $entity ) {

    $id = get_the_ID();
    $temprend = get_post_meta($id, ‘kksr_sd’, true);
    //var_dump($temprend);

    $i = get_post_meta($id, ‘_kksr_count_default’, true );
    $sumstar = get_post_meta($id, ‘_kksr_ratings_default’, true );
    $star = round($sumstar / $i);
    $entity[‘offers’][‘priceCurrency’] = ‘IRR’;
    $entity[‘aggregateRating’] = [
    “@type” => “AggregateRating”,
    “ratingValue” => “$star”,
    “reviewCount” => “$i”,
    ];
    //var_dump($entity);
    return $entity;
    }
    ?>

    The problem was solved, but 2 schemas were created for each product, one of which has error 4217 and the other is correct.
    RB

    is there any way to remove the incorrect schema?

    Rank Math EDD

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

    We apologize for the inconvenience you’re facing with the duplicated schema on your website. Thank you for providing the code snippet you added to the rank-math.php file in the child theme to fix the problem.

    To remove the incorrect schema, you can use a filter to remove the schema from the product category pages. You can add the following code snippet to your WordPress theme’s functions.php file or rank-math.php file:

    /**
     * Filter to remove all Schema from product category pages
     */
    add_filter('rank_math/json_ld', function ($data, $jsonld) {
        if (is_product_category()) {
            return [];
        }
        return $data;
    }, 99, 2);

    This code will remove the Schema markup from all product category pages on your site. Once you’ve added the code, click the Update File button to save the changes.

    If you encounter any issues or need further assistance, please feel free to reach out to us. We’d be happy to help you at any given time.

    Filter to remove Schema from all product category pages

    I hope this helps! If you have any other questions or need further assistance, please let us know.

    Sources:
    How to Fix Aggregate Rating Error » Rank Math
    How to Make Your Theme Rank Math Compatible » Rank Math
    Remove All Schema from Product Category Pages » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that this issue might have caused.

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    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.

    Thank you for your follow-up.
    Of course, I must mention that I am using the unofficial Rank Meth pro. We cannot make international purchases in Iran, so we have to use intermediary sites in Iran.

    I understand that your priority should not be the answer to my problem, but in any case, I am extremely grateful to you and your support.

    Hi, has this ticket been checked?

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    If I add this code all schemas will be removed right?
    How I should enable schema again?

    I tested the code in the backend (test code) and no duplicated post was shown
    Rank Math Schema

    but when I analyze the URL duplicate Schema is shown.

    Alhan
    Rank Math free

    Hello,

    We attempted to use the login link provided, but it redirected us to the homepage of your website instead of the intended dashboard page.

    It seems that the login link’s validity may have already expired.

    Could you kindly extend the expiration period of this link?

    This will enable us to proceed with our investigation and provide the necessary assistance.

    We really look forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘EDD Duplicated Schema problem’ is closed to new replies.