Created
February 3, 2019 11:26
-
-
Save iamgabrielma/2eb8cd2a1b5352e5bf444211b569a345 to your computer and use it in GitHub Desktop.
DMCA-WP to disable specific page/content
This file contains 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
/* | |
Plugin Name: DMCA content removal | |
Description: For DMCA content removal requests | |
Author: aaron-p9F6qB-2oq-p2 | |
*/ | |
function wpcom_dmca() { | |
if ( is_single( 1057 ) ) { | |
global $wp_query; | |
$wp_query->set_404(); | |
//This results in 451 headers being sent and a 404 message displayed | |
status_header(451); | |
nocache_headers(); | |
} | |
} | |
add_action( 'wp', 'wpcom_dmca' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment