[wp-hackers] Should Monthly Archive Pages ever return 404?

Austin Matzko if.website at gmail.com
Tue Mar 10 01:33:28 GMT 2009


On Mon, Mar 9, 2009 at 6:15 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> "Austin Matzko" <if.website at gmail.com>
>> You can change the 404s using existing filters and
>> action hooks, unless I'm mistaken.
>
> If you are able to point me to them I would appreciate it.

Here's what I would do if I wanted all month requests to have 200
response headers:

 add_action('wp', 'no_monthly_404s');

 function no_monthly_404s() {
        $m = get_query_var('m');
        $monthnum = get_query_var('monthnum');
        if ( ! empty( $m ) || ! empty( $monthnum ) )
                        status_header( 200 );
 }


More information about the wp-hackers mailing list