You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
cosmopet-architecture/wp-content/themes/cosmopet/global-functions/seo-functions.php

18 lines
666 B

<?
add_filter('wpseo_canonical', '__return_false');
add_filter('wpseo_opengraph_url', '__return_false');
add_filter('wpseo_add_x_default_hreflang', '__return_false');
add_filter('wpseo_disable_adjacent_rel_links', '__return_true');
/* Добавление canonical-ссылок */
add_action('wp_head', function () {
if (!is_admin()) {
static $canonical_added = false;
if ($canonical_added)
return;
$canonical_added = true;
$current_url = strtok(trailingslashit(home_url($_SERVER['REQUEST_URI'])), '?');
echo '<link rel="canonical" href="' . esc_url($current_url) . '" />' . "\n";
}
});