Last active
January 9, 2018 16:50
-
-
Save wpscholar/1281497 to your computer and use it in GitHub Desktop.
Force WordPress to return a 404 status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Force WordPress to return a 404 status | |
*/ | |
global $wp_query; | |
$wp_query->set_404(); | |
status_header( 404 ); | |
nocache_headers(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment