Skip to content

Commit 22189ae

Browse files
committed
Change author pages to trigger a 404 instead of redirect
1 parent 5b2ceb9 commit 22189ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

inc/disable-author.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ function disableauthors_disable_author_page() {
88
global $disableauthorsDisableAuthorPages;
99

1010
if (is_author() && 'on' === $disableauthorsDisableAuthorPages) {
11-
wp_redirect(get_option('home'), 301);
11+
$wp_query->set_404();
12+
13+
status_header(404);
14+
15+
require get_404_template();
16+
1217
exit;
1318
}
1419
}

0 commit comments

Comments
 (0)