Add canoncial from all pages to the first. Wordpress open

Add canoncial from all pages to the first. Wordpress

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators
function noindex_paged() {
	if ( is_paged() ){   ?>
	
	<link rel="canonical" href="<?php 
	global $wp;
	$current_url = home_url(add_query_arg(array(), $wp->request));
	$s = home_url(add_query_arg(array(), $wp->request));
	echo strstr($s, 'page', true);?>"/>
	<?php 
	}
} 

add_action('wp_head','noindex_paged',2);
0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation