Support » Plugin: Jetpack by WordPress.com » double related posts

  • Resolved momenarts

    (@momenarts)


    Hello
    Lately I start building a store
    I saw double related posts inside the products pages ,
    then I saw this code :-

    function exclude_jetpack_related_from_products( $options ) {
    if ( is_product() ) {
    $options[‘enabled’] = false;
    }
    return $options;
    }
    add_filter( ‘jetpack_relatedposts_filter_options’, ‘exclude_jetpack_related_from_products’ );

    as I read it will works if I add it in my theme file functions.php , tried more than twice and its still double related posts !
    after that I saw plugin called “code snippet ” and unfortunately nothing changed too !
    how can I fix it please ? “urgent”

    Best Regards

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support KokkieH

    (@kokkieh)

    Hi there,

    Only the top line of three related posts are coming from Jetpack. The four Related Products showing below that are coming from WooCommerce, not from Jetpack.

    Did you get that code snippet from https://jetpack.com/support/related-posts/customize-related-posts/#woocommerce?

    I tried it on a test site and it doesn’t appear to work, no. I’m reporting this to the team so they can check if something has changed in this regard.

    But you can probably just disable Jetpack related posts completely – you’re not publishing any blog posts on your site, so you don’t really need that feature to be active. If you disable it, only the Related Products from WooCommerce will appear.

    You can disable Jetpack Related Posts from Jetpack Settings ->Traffic:

    https://jetpack.com/support/related-posts/

    Or if you prefer to use Jetpack’s feature, you can disable WooCommerce’s related products using the code snippet here:

    https://docs.woocommerce.com/document/remove-related-posts-output/

    As an aside: Avoid editing your theme’s functions.php directly – when the theme updates those changes will be lost. Please always use a Code Snippets plugin, or else create a child theme, if you want to add custom code like this to your theme.

    momenarts

    (@momenarts)

    Hello
    Thank you for your reply .

    Well I don’t think now I will disable jetpack from my website ;I’m I’m using shortcode jetpack related posts ,
    so I need to have related posts in my website .

    But as I mentioned in my topic that I start building my store lately ,
    I have in the products posts tow related one belongs for jetpack and the other one belongs to WooCommerce .

    how I can disable jetpack related posts from “products posts” and keep WooCommerce related products working alone ?

    Note: I’m not professional in wordpress and yes I use child theme in my website .

    Best Regards

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator 🚀

    It does seem like a regression was introduced, we’re working on a fix now: https://github.com/Automattic/jetpack/pull/11560

    We have it pegged for the 7.2 release which is targeted for the first Tuesday of April.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.