October 2014
Forcing a 404 in WordPress
If you ever find yourself in a position where you need to force a 404, this can be done by hooking into the wp action hook and setting the 404 status on the $wp_query object via the set_404() object method. Doing this will ensure WordPress checks for the 404.php template file and uses it, if available. add_action(‘wp’, […]