• Home
  • Systems
  • Networking
  • WordPress
  • Web
  • Geekery

Analysis and Review

Modify or Remove Canonical Created by Yoast SEO Plugin

July 27, 2016 by Kurt Turner

Canonical URL information is injected into the head of your webpage when using Yoast SEO plugin. If you need to remove the injected canonical URL from a particular single page or post you can do so with the below code snippet by placing it into your functions.php file within your WordPress theme.

Canonical URL helps deal with duplicate content issues by utilize the rel=canonical tag. The rel=canonical tag passes ranking power like a 301 redirect and takes less time to implement.

 
[code]
function wpseo_canonical_exclude( $canonical ) {
global $post;
if ( $post->ID == -1) {
$canonical = false;
}
return $canonical;
}
add_filter( ‘wpseo_canonical’, ‘wpseo_canonical_exclude’ );
[/code]

Filed Under: Wordpress

Latest and Greatest

Apache vs Nginx for WordPress

Certbot Lets Encrypt And WordPress MU Multi-Site

How To Find and Replace Multiple File in MS Word

How To Get Stretch Res on Windows 10 AMD Radeon For Game Play

This is the ASUS Chromebox we've been running for 2 years as our "brain" for our home grown digital display kiosk.

DIY Digital Signage Bulletin Board or Kiosk

© Copyright Analysis And Review · All Rights Reserved ·