Slash is not coming in canonical tag in wordpress
We have installed the SEO by yoast plugins in wordpress but there is issue on home page on site. Canonical tag is not proper in homepage, it does not take slash at the end of the canonical tag.
Solution for Canonical tag:
You can able to solve this issue by editing the plugins file from wordpress.
Step 1: First of all just download the plugin class-frontend.php page from the server.
Step 2: Go to wp-content\plugins\wordpress-seo\frontend\class-frontend.php and download it.
Step 3: Open this class-frontend.php page and edit this file.
Step 4: Go to line number 884 and you just comment the line i.e.
echo '<link rel="canonical" href="' . esc_url( $canonical, null, 'other' ) . '/" />' . "\n";
Or if there is no slash present on canonical tag then put it .
Step 5: Then upload the edited file class-frontend.php page on server.
Step 6: And then see on browser, you will get proper canonical tag.
Post a Comment