Skip to content

Commit 3b9ac65

Browse files
authored
Merge pull request #4 from firstandthird/not-found-not-redirect
Change author pages to trigger a 404 instead of redirect
2 parents 5b2ceb9 + 22189ae commit 3b9ac65

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)