Disable JSON VideoObject

#23053
  • Resolved Rush
    Rank Math free

    Hello rank math.
    For some reason I want to disable json


    @type
    ”:”VideoObject”

    [{"@context":"https:\/\/schema.org","@type":"VideoObject","name":"test","description":"Test","uploadDate":"2019-12-13T12:48:51+00:00","duration":"PT5M","contentUrl":"","embedUrl":"","interactionCount":"","thumbnailUrl":"https:\/\/localhost\/wp-content\/uploads\/2019\/12\/test.jpg"}]

    how can I do that.

    I have tried this filter but
    It has deleted Breadcrumbs and all json data on the site

    add_action( 'rank_math/head', function() {
    	global $wp_filter;
    	if ( isset( $wp_filter["rank_math/json_ld"] ) ) {
    		unset( $wp_filter["rank_math/json_ld"] );
    	}
    });

    thank you

    • This topic was modified 5 years ago by Rush.
Viewing 1 replies (of 1 total)
  • Michael Davis
    Rank Math pro

    Hello,

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

    You can use the following code on your theme’s functions.php file to disable this schema type:

    /***** Rank Math filter to disable Video schema ****/
    add_filter( "rank_math/snippet/rich_snippet_video", function( $value, $parts, $data ) {
    	return true;
    }, 10, 3 );
    

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Disable JSON VideoObject’ is closed to new replies.