HTML
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php $queried_object = get_queried_object(); ?>
<?php if( get_field('title', $queried_object) ): ?>
<title><?php the_field('title', $queried_object); ?></title>
<?php else :?>
<title><?php echo wp_get_document_title(); ?></title>
<?php endif; ?>
<meta name="description" content="<?php the_field('description', $queried_object); ?>">
<meta name="keywords" content="<?php the_field('keywords', $queried_object); ?>">
<?php if( get_field('скрыть_от_индексации_страницу', $queried_object) ): ?>
<meta name="robots" content="noindex, nofollow" />
<?php endif; ?>
<link rel="canonical" href="<?php $current_url = get_permalink(); echo esc_url($current_url); ?>" />
// ссылка на текущую страницу
function current_page_link_shortcode() {
$current_url = get_permalink();
return '<a href="' . esc_url($current_url) . '">Ссылка на текущую страницу</a>';
}
add_shortcode('current_page_link', 'current_page_link_shortcode');
Плагин для sitemaps.xml — Google XML Sitemaps (Автор — Auctollo)