WordPress plugins holiday deals

55%OFF

Happy Holiday

Our Holiday Deals are live

00

Days

00

Hours

00

Min

00

Sec

Use Code:
Auto-Applied
Get The Deal
[object Object]
WP Adminify

How to Remove Canonical Link from head section

The Header Security feature in WP Adminify allows you to control which meta tags appear in your WordPress site’s head section, including the removal of the canonical link tag. This tag helps search engines understand the preferred URL for a given piece of content, but some users may choose to remove it for specific use cases.

Here’s how you can remove the canonical tag from your site's head section:

1. Access the Header Security Settings

From the WordPress Dashboard:

  • Navigate to WP Adminify > SecurityHeader Security from the menu.

2. Enable Header Security

Ensure that the Header Security feature is turned on by toggling the Show switch to the green, enabled state.

3. Remove the Canonical Link Tag

The <link rel="canonical"> tag specifies the "canonical" or preferred version of a webpage URL. It is used by search engines to consolidate duplicate content by identifying the main version of a page, helping improve SEO and reduce content duplication issues.

Why Remove It?

In certain cases, you may not want to specify canonical URLs, such as when you're handling SEO differently or when you’re using other tools for SEO management. Removing the tag can also be useful if you're doing development or testing and don’t want the canonical tag to interfere with search engine indexing.

To remove it:

  • In the Header Security settings, find the option labeled Remove <link rel="canonical" href="https://www.site.com/some-url" /> from head section.
  • Check the box next to this option to remove the canonical link tag from your website’s head section.
Remove Link Rel canonical from the Head section

Note: If you prefer to remove canonical via Code, then just copy and paste the following code inside your funciton.php file.

/** Remove Canonical URL **/ remove_action('embed_head', 'rel_canonical'); add_filter('wpseo_canonical', '__return_false');

4. Save Changes

Scroll down and click Save Changes to apply your new settings.

5. Verify the Removal

After making the change, you can check to ensure the canonical tag has been removed:

Look through the source code to confirm that the canonical tag no longer appears in the head section.

Open your website in a browser.

Right-click the page and select View Page Source.

Didn’t find what you were looking for? Get in touch!

Updated on December 2, 2024

Was this helpful to you?

Coupons
icon

Navigate on your Dashboard faster with WP Spotlight!

Try It Now