• Resolved Imageliubing2007

    (@liubing2007)


    I need to disable the schema data for a specific page/post or post type, even based on some conditions programmatically, how I can do that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support ImageAkshay A

    (@akshaycode1)

    Hi,

    Thank you for reaching out to us. Kindly refer to this screenshot and use this type of placement. This will help you achieve your desired output. You can add more placements as per your choice to modify the post or page. If you need any further assistance, please let us know.

    • This reply was modified 4 months, 2 weeks ago by ImageAkshay A.
    Thread Starter Imageliubing2007

    (@liubing2007)

    Hi,

    Thanks for your quick reply, but I want to remove the schema data on a specific page programmatically, is it possible?

    Plugin Support ImageAkshay A

    (@akshaycode1)

    Hi, do you want to use a specific type of shortcode to remove the schema data from a post or page? Is that what you’re trying to do?

    Thread Starter Imageliubing2007

    (@liubing2007)

    Hi, such as a wp filter to disable the schema data, so I can put it in theme functions.php to remove it based on some customized conditions?

    Plugin Support ImageAkshay A

    (@akshaycode1)

    Hi, you can use the filter below.

    apply_filters( ‘saswp_filter_comparison_logic_checker’, $result );

    Just check the page ID and return ‘false’ for that page to disable the schema on it. Please try this and let us know if it works for you.

    Thread Starter Imageliubing2007

    (@liubing2007)

    Hi,

    Thanks, I tried below, but still have schema output.

    add_filter( ‘saswp_filter_comparison_logic_checker’, ‘my_disable_schema’, 10, 1 );

    function my_disable_schema( $result ) {
    return false;
    }

    Plugin Support ImageAkshay A

    (@akshaycode1)

    Hi,

    Please try replacing false with 0 and check again. Let us know if it works for you. We’ve also raised a GitHub ticket regarding this and it will be addressed in an upcoming update.

    Here is the Ticket.

    • This reply was modified 4 months ago by ImageAkshay A.
    Plugin Support ImageAkshay A

    (@akshaycode1)

    Hi,

    Hope you are doing well. We have just released an update version 1.49, in which we have addressed this concern. Kindly update the plugin to the latest version, clear the cache and give it a try.

    Thread Starter Imageliubing2007

    (@liubing2007)

    Ok, thanks, we will try.

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

You must be logged in to reply to this topic.