Adding breadcrumbs code using WPCode

#747924
Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello,

    I apologize for the issue you are facing. To add the breadcrumbs code using WPCode snippets, you should add it under the PHP snippet.

    You can follow these steps to add the code:

    1. Navigate to Appearance → Theme File Editor in your WordPress admin area.
    2. Select the PHP snippet option.
    3. Paste the following code snippet:
    
    4. Save the changes.
    
    If you encounter any difficulties or have further questions, feel free to reach out to [Rank Math’s support forum](https://rankmath.com/support/). We are here 24x7 to assist you. 
    
    Thank you for reaching out!

    Sources:
    How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math
    How to Make Your Theme Rank Math Compatible » Rank Math
    Rank Math SEO Filters and Hooks for Developers – Rank Math

    Thanks. I’ve added to the snippets. May i know does it remove the “product” on the breadcrumb as shown in the screen shot: https://www.flickr.com/photos/200152043@N08/53537127235/in/dateposted-public/

    I’m hoping the product name could show as entirely as possible to help with seo.

    Thanks again.

    Hello,

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

    You’ll have to add the breadcrumbs code to your single.php/single-page.php or header.php of your theme file.

    Regarding the breadcrumbs on SERPs, you can remove the breadcrumbs schema from your products by using the following filter on your website:

    add_filter( 'rank_math/json_ld/breadcrumbs_enabled', function( $data ) {
        if(is_product()){
            return false;
        }
        return $data;
    });
    

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Hi, but i’ve already added to php snippets as told by rankmath bot. Could u check the screenshot if i’m doing it correctly?

    https://www.flickr.com/photos/200152043@N08/53539414000/in/dateposted-public/

    If yes, can i add the above code beneath it? So it will be

    <?php

    if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs();

    add_filter( ‘rank_math/json_ld/breadcrumbs_enabled’, function( $data ) {
    if(is_product()){
    return false;
    }
    return $data;
    });

    Thanks!

    Hello,

    We apologize for the wrong bot reply but please remove the PHP code you added to WP Code. To show the Rank Math breadcrumbs via PHP, you will need to add it to the single.php or header.php file of your active theme.

    Visit https://your-site-url.com/wp-admin/theme-editor.php and choose the appropriate file to add the breadcrumb code to your active theme.

    Regarding the other code we shared, you can add this to WP Code, but please add it on a separate snippet.

    We hope this helps you resolve the issue. Don’t hesitate to contact us again with any other questions or concerns regarding Rank Math. We are always happy to help.

    Thank you for choosing Rank Math!

    I’ve removed the php code told by the bot. Is there anyway to add the php code (<?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>) using wpcode tho? I dont have a child theme so adding to main theme would mean i have to revisit when update. Wpcode does have Global Header & Footer. Could i add it in the header following other codes i already have in there?

    Also, could u please clarify which section of wpcode should i add the following?

    add_filter( ‘rank_math/json_ld/breadcrumbs_enabled’, function( $data ) {
    if(is_product()){
    return false;
    }
    return $data;
    });

    do i add i in the php snippet? thanks

    Hello,

    1. I’m afraid that is not possible. The breadcrumb php code has to be added to your theme files. If you do not have a child theme, you can create one using this guide. Or you can use a plugin to generate one.

    2. Yes, please select the PHP Snippet as your Code Type,

    Thank you for your patience and cooperation

    does second option:

    add_filter( ‘rank_math/json_ld/breadcrumbs_enabled’, function( $data ) {
    if(is_product()){
    return false;
    }
    return $data;
    });

    has to enable breadcrumb in rankmath for it to work? i mean the there are already breadcrumbs in my product search, so would the code still help me remove “product” in the existing breadcrumbs?

    Hello,

    The filter you shared only applies to Rank Math breadcrumbs.

    If you already have breadcrumbs showing on your product pages, then it is coming from a different plugin or active theme.

    Also, we can check your website if we can apply the breadcrumbs through WP Code. Normally, the breadcrumbs code is added to your theme files. You may also get in touch with your theme if they can apply the code to their files without affecting it when it updates.

    For us to check your site, 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.

    Dylan Joo
    Rank Math free

    Hi, i just added the rankmath breadcrumbs code using php snippets and before posts as location. Could you check the following product link to see if i added correctly, so i can enable the breadcrumbs setting?

    view-source:https://cultfave.com/product/beauty-of-joseon-glow-serum-propolis-niacinamide/

    If wrong location, i can try add it “before content” or “site wide header” as location.

    Thanks

    Hello,

    Without the option to show the breadcrumbs enabled, the functions won’t work, and as such we cannot see any breadcrumbs on the page you shared.

    At the moment, the page you shared doesn’t have any breadcrumbs.

    Looking forward to hearing back from you.

    Dylan Joo
    Rank Math free

    Ok

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

You must be logged in to reply to this ticket.