Last active
January 6, 2016 13:17
-
-
Save asifsomy/50f56e2d8c6361241fa1 to your computer and use it in GitHub Desktop.
Remove Unwanted Archive URLs
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
function cd_remove_unwanted_archives(){ | |
if( is_search() || is_category() || is_tag() || is_date() || is_author() ) { | |
global $wp_query; | |
$wp_query->set_404(); | |
} | |
} | |
add_action('template_redirect', 'cd_remove_unwanted_archives'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment