Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Just a note: the term "using WordPress as a CMS" is tautological. WordPress is a CMS. –  Chip Bennett Jan 25 '12 at 15:57

1 Answer 1

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' );
share|improve this answer
    
This is great, but is_404() still returns false. Any way to trick WP into thinking it's really a 404? –  dave1010 Nov 23 '12 at 14:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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