• function yasglobal_exclude_post_types( $post_type ) {
      if ( $post_type == 'custompost' ) {
        return '__true';
      }
      return '__false';
    }
    add_filter( 'custom_permalinks_exclude_post_type', 'yasglobal_exclude_post_types');

    This code only works with 1 custom post type. I need to disable it from multiple post type – that is for page, post, course, and lesson (from woocommrece sensi), but only want to use it for woocommerce product. Using the code two times and change the post type does not work, which give error, and site directly goes down.

  • The topic ‘Disable the Custom Permalinks for multiple post type’ is closed to new replies.