From 813dcb4ae72578dcca771f9c0220494db313871f Mon Sep 17 00:00:00 2001 From: Dekart Deploy Bot Date: Sat, 14 Nov 2026 18:57:22 +0000 Subject: [PATCH] GLOBAL --- wp-content/themes/dekart/inc/seo-cleanup.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp-content/themes/dekart/inc/seo-cleanup.php b/wp-content/themes/dekart/inc/seo-cleanup.php index 15057a8..7b53e6f 100644 --- a/wp-content/themes/dekart/inc/seo-cleanup.php +++ b/wp-content/themes/dekart/inc/seo-cleanup.php @@ -31,6 +31,26 @@ function dekart_robots_disallows(string $path): bool return false; } +// авторские архивы выключены: дубль блога без своего контента +add_action('init', function () { + $titles = get_option('wpseo_titles'); + if (! is_array($titles) || ! empty($titles['disable-author'])) { + return; + } + $titles['disable-author'] = true; + update_option('wpseo_titles', $titles); +}, 21); + +add_action('template_redirect', function () { + if (! is_author()) { + return; + } + global $wp_query; + $wp_query->set_404(); + status_header(404); + nocache_headers(); +}, 1); + // таксономии с noindex,follow (functions.php) function dekart_sitemap_noindex_taxonomies(): array {