1

I would like to disallow the authors (of posts for example) in the file robots.txt. In fact, I noticed that for some of my sites, Google indexed the authors of articles, which I don't want to. Someone thinks is it possible ?

(I tried something like Disallow: /author/ but I'm not sure it works...)

Thank you in advance,

ArbreMojo.

2
  • Do you use Yoast SEO?
    – Pim
    Commented Sep 14, 2018 at 7:58
  • Yes I do ! :) Is there a way to do that with Yoast SEO ?
    – ArbreMojo
    Commented Sep 14, 2018 at 7:59

1 Answer 1

4

If you use Yoast SEO, you can go to Users > All Users, and in the Yoast SEO settings, check Do not allow search engines to show this author's archives in search results. See this link.

OR

With robots.txt, you can add:

User-agent: *
Disallow: /author/*

OR

You can also add the robots meta-tag to the appropriate pages:

function custom_function_filter_wp_robots( $robots ) {
    if(is_author()) {
        $robots['noindex'] = true;
    } 

    return $robots;
}

add_filter( 'wp_robots', 'custom_function_filter_wp_robots' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.