Disable Author Pages
Latest update: February 4, 2019 | Reading time: 1 to 2 minutesYou can disable the Author pages using one of the following methods:
(1) Through the child theme’s functions.php file (Reference)
Open your child theme’s functions.php file and paste the following PHP code:
remove_filter('template_redirect', 'redirect_canonical');
add_action('template_redirect', 'ple_disable_author_archives');
function ple_disable_author_archives() {
if (is_author()) {
global $wp_query;
$wp_query->set_404();
status_header(404);
} else {
redirect_canonical();
}
}
(2) Through the Disable Author Page free plugin
(3) By overriding the author.php file (Reference)
wCreate a file named author.php inside your child theme’s root directory and paste the following code:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: /");
?>
(4) By using the Yoast plugin
If you already have the Yoast plugin installed, you can follow the instructions here.