Nigel M Rodgers (@rodgersnigel)

Forum Replies Created

Viewing 1 replies (of 1 total)

  • Nigel M Rodgers
    Participant

    @rodgersnigel

    Hi,

    I just did something similar for Rank Math SEO plugin:

    
    
    /**
     * Sets bbPress user profile pages to noindex
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
        
        if (!bbp_is_single_user_profile()) {
            return $robots;
            }
        unset( $robots['index']);
        $robots['noindex'] = 'noindex';
        return $robots;
    });
    

    Cheers

Viewing 1 replies (of 1 total)