Toolonomy Logo
Last Updated on: October 31, 2020

Disable Jetpack Related Posts for Specific CPTs [PHP Snippet]

If you want to disable Jetpack related posts for specific custom post types then this code snippet could be helpful to you to achieve just that.

Please Note: This snippet has been stopped working all of sudden and I would try to replace it with the working one as soon as I find the solution.

/* Advanced Scripts Method to Add This Snippet */
/* 
Title: Disable Jetpack Related Posts for Specific CPTs
Type: PHP: Custom Code
Location: Plugins Loaded
Priority: 10
*/

function sw_jetpack_disable_related_posts( $options ) {
    if ( is_singular( 'custom-post-type-name' ) ) {
        $options['enabled'] = false;
    }
    return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'sw_jetpack_disable_related_posts' );

Explore our Facebook Community

Consider joining our Toolonomy Facebook Community if you want to involve in the group discussion with like-minded people about Business Development Tools.
Join Now
Made with ❤ for Digital Entrepreneurs
Copyright © 2018 - 2022 SyncWin | All Rights Reserved.
Top crossmenu