noindex users author issue

#11014
  • Resolved Karanadiksha
    Rank Math free

    Hi,

    I need to noindex all users (i have 10k) and tried from global configuration but then I discover on every user profile the seo seetings are configured to “index” and this block the global configuration.

    So, how can I make all user to default noindex on their profiles?

    Thanks

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can set all the pages to noindex by adding the following code snippet on your theme’s functions.php file:

    /**
     * Filter Rank Math author robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    if(is_author()){
    $robots['index'] = "noindex";
    return $robots;
    }
    	return $robots;
    });

    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 ‘noindex users author issue’ is closed to new replies.