How to set status codes such as 401 and 403?
Setting a 404 in WordPress can be done quite easily using the set_404() method of WP_Query and the status_header() function. Here’s an example taken from WP::handle_404(): $wp_query->set_404(); status_header( 404 ); nocache_headers(); If I wanted my tag archive to be accessible to authenticated users only, setting a 404 page for non-authenticated users wouldn’t make sense because … Read more