Created
May 3, 2024 11:38
-
-
Save tweenpix/02ad3f754a6246c6c113f06b94e45219 to your computer and use it in GitHub Desktop.
Wordpress disable archive of tag, author, date
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
function wpcourses_disable_date_archives( $query ){ | |
if( is_date() || is_tag() || is_author() ) { | |
wp_redirect( home_url() ); | |
exit; | |
} | |
} | |
add_action( 'parse_query', 'wpcourses_disable_date_archives' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment