[wp-hackers] Force 404

Gavin Pearce Gavin.Pearce at 3seven9.com
Tue May 17 16:15:01 UTC 2011


status_header('404');
$wp_query->set_404();

init is too early to call this (obviously), try further down the line.

G

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Robert
Lusby
Sent: 17 May 2011 16:05
To: wp-hackers at lists.automattic.com
Subject: [wp-hackers] Force 404

Sorry I know this has been discussed before, but my Google skills seem 
to be evading me this afternoon!

What's the correct way to force WordPress to return a 404?

Require the WordPress 404 page to be displayed, and the 404 headers, 
without any 302/301 'faffing', obviously HTACCESS can't really do this.

TIA,
Rob
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list