fix seo
This commit is contained in:
@@ -19,6 +19,19 @@ function sev_tort_query_vars( $vars ) {
|
||||
|
||||
add_filter( 'wp_sitemaps_enabled', '__return_false' );
|
||||
|
||||
add_action( 'template_redirect', 'sev_tort_redirect_order_page_to_home', 1 );
|
||||
function sev_tort_redirect_order_page_to_home() {
|
||||
$path = isset( $_SERVER['REQUEST_URI'] ) ? parse_url( wp_unslash( $_SERVER['REQUEST_URI'] ), PHP_URL_PATH ) : '';
|
||||
$path = trim( (string) $path, '/' );
|
||||
|
||||
if ( 'torty-na-zakaz' !== $path ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_safe_redirect( home_url( '/' ), 301, 'Sevastopol Tort' );
|
||||
exit;
|
||||
}
|
||||
|
||||
add_filter( 'redirect_canonical', 'sev_tort_disable_static_seo_redirects', 10, 2 );
|
||||
function sev_tort_disable_static_seo_redirects( $redirect_url, $requested_url ) {
|
||||
if ( sev_tort_is_static_seo_path() ) {
|
||||
@@ -97,11 +110,11 @@ function sev_tort_send_sitemap() {
|
||||
);
|
||||
|
||||
foreach ( $pages as $page ) {
|
||||
if ( empty( $page['indexable'] ) ) {
|
||||
if ( empty( $page['indexable'] ) || 'torty-na-zakaz' === $page['slug'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$priority = in_array( $page['slug'], array( 'torty-na-zakaz', 'bento', 'detskie', 'svadebnye', 'na-den-rozhdeniya', 'ceny' ), true ) ? '0.9' : '0.8';
|
||||
$priority = in_array( $page['slug'], array( 'bento', 'detskie', 'svadebnye', 'na-den-rozhdeniya', 'ceny' ), true ) ? '0.9' : '0.8';
|
||||
|
||||
$urls[] = array(
|
||||
'loc' => home_url( '/' . $page['slug'] . '/' ),
|
||||
@@ -179,7 +192,7 @@ function sev_tort_llms_lines() {
|
||||
'- Контактный телефон: ' . sev_tort_site_phone(),
|
||||
'',
|
||||
'## Услуги',
|
||||
'- Торты на заказ: https://sevastopol-tort.ru/torty-na-zakaz/',
|
||||
'- Торты на заказ: https://sevastopol-tort.ru/',
|
||||
'- Бенто-торты: https://sevastopol-tort.ru/bento/',
|
||||
'- Детские торты: https://sevastopol-tort.ru/detskie/',
|
||||
'- Свадебные торты: https://sevastopol-tort.ru/svadebnye/',
|
||||
|
||||
Reference in New Issue
Block a user