• Resolved Harry

    (@dibbyo456)


    If a post/page set to noindex then there is no point to add schema output to it.
    schema output should be automatically set to false on those pages.

Viewing 1 replies (of 1 total)
  • Thread Starter Harry

    (@dibbyo456)

    Actually I made a code to do it. This will disable JSON-LD output to noindex pages.

    add_filter( 'wpseo_robots', function( $string ) {
        if ( strpos( $string, 'noindex' ) !== false ) {
            add_filter( 'wpseo_json_ld_output', '__return_false' );
        }
        return $string;
    });
    • This reply was modified 4 years, 10 months ago by Harry.
Viewing 1 replies (of 1 total)
  • The topic ‘[Enhancement] Disable Schema output on noindex pages.’ is closed to new replies.