1

I'm using wordpress as a CMS. Various users on the staff write posts that get incorporated into pages manually.

As far as the outside world is concerned, this is just a bunch of static pages. I want to remove all concept of Authorship, Categories, etc. It's come to my attention that I can browse to domain.com/author/userName and see the author archive.

How do I disable this? I would like it to return a 404.

1
  • Just a note: the term "using WordPress as a CMS" is tautological. WordPress is a CMS. Jan 25, 2012 at 15:57

1 Answer 1

4

I would filter template_redirect, with an is_author() conditional, e.g.:

function theme_slug_redirect_author_archive() {
    if ( is_author() ) {
        // Put your redirect code here;
        // Redirect to home_url(), or 
        // return a 404, or whatever
    }
}
add_action( 'template_redirect', 'theme_slug_redirect_author_archive' );
1
  • This is great, but is_404() still returns false. Any way to trick WP into thinking it's really a 404?
    – dave1010
    Nov 23, 2012 at 14:31

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.