Duplicate Canonical Link
-
I tried submitting my blog to bing, but I got an error, my domain is not indexed because there are 2 Canonical tags, under the html source code of my site.
<head>
<meta charset=”UTF-8″ />
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<link rel=”pingback” href=”https://bukalowongan.com/xmlrpc.php” />
<link rel=”canonical” href=”https://bukalowongan.com/” /><link rel=”next” href=”https://bukalowongan.com/page/2/” /><title>Informasi Lowongan Kerja Terbaru Juni 2021 » CPNS 2021</title>
<meta name=”description” content=”Informasi Lowongan Kerja Terbaru Juni 2021″ />
<meta name=”robots” content=”follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large” />
<link rel=”canonical” href=”https://bukalowongan.com/” />`temporarily this problem can be solved by adding code to functions.php that I got from <a href=”https://support.rankmath.com/ticket/how-to-remove-rel-canonical-tag/” rel=”noopener” target=”_blank”>https://support.rankmath.com/ticket/how-to-remove-rel-canonical-tag/</a>
this is the source code
/** * Allow changing of the canonical URL. * * @param string $canonical The canonical URL. */ add_filter( 'rank_math/frontend/canonical', function( $canonical ) { //create conditional here to check for the tax page if(condition){ returns ''; } return $canonical; });
but is this method recommended?
looks like wordpress already added Canonical tag by default. that’s why Canonical duplicates happen.
so how do i keep using the method from https://support.rankmath.com/ticket/how-to-remove-rel-canonical-tag/
or is there another way?
Thank you in advance.
Link my websiteThe page I need help with: [log in to see the link]
- The topic ‘Duplicate Canonical Link’ is closed to new replies.