Adding the canonical tag to your WordPress blog might be essential if you do not want search engines to see your content twice (= duplicate content) and thus giving you a penalty as such.
To add this tag, simply go to your theme’s folder and find
header.php. Now, add the following somewhere after
<head> but before
<?php if ( is_singular() ) echo '<link rel="canonical" href="' . get_permalink() . '" />'; ?>
Clear your cache and see if this meta tag was added.
Since WordPress is constantly innovating and adding features to its core, this CMS now natively supports the
rel="canonical" link-tag. To request WordPress to add this tag to your website’s pages, you have to paste this code into
functions.php (found in your themes directory, such as wp-content/themes/YourTheme):
add_action( 'wp_head', 'rel_canonical' );
In case you want to specifically remove the canonical rel-tag in the
<head> of your WordPress blogposts and pages, you may choose to specifically disable the build-in
rel_canonical() function that WordPress offers:
remove_action( 'wp_head', 'rel_canonical' );