Support » Fixing WordPress » Remove canonical link from header

  • Resolved tshirtfiend


    Somehow, my site is creating a canonical link in the header. It’s not part of my header file, and I disabled canonical links in the All-in-1 SEO plugin. Here’s what the first part of my header looks like:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" <?php language_attributes(); ?>>
    	<head profile="">
    		<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    		<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    		<link rel="shortcut icon" href="<?php bloginfo('url'); ?>/favicon.ico" type="image" />
    		<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    		<!--[if lt IE 8]>
    		<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/iefix.css" type="text/css" media="screen" />
    		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    		<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    		<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script>

    What could be causing this? As mentioned, I am using an SEO plugin, but the links are created even if I don’t have any plug-ins activated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    I think that canonical links are a part of WordPress as of 2.9. You’d have to check with the plugin authors to see if they remove it or not.

    Is there a way to disable them in WordPress?

    Honestly, I’m a little baffled by the request in general. My client has hired an SEO expert, who thinks canonical URLs are bad.

    Also, I don’t have canonical links in any of the headers of the other WP sites.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Your SEO expert is … well, I’d say he’s odd. I mean, I get why it MIGHT be a problem, but I’ve yet to see it happen in the wild.

    If it’s not in your theme itself, then I’d try out this:

    Should help you.

    Thanks for the link, but I don’t think that it’s exactly what I’m looking for. I think that stops the redirect from non-canonical pages, but what I need to do is remove the
    <link rel='canonical' href='' />
    from the header entirely. So the redirect wouldn’t take effect, but especially there wouldn’t be a <link> in the header.

    I agree re: the expert. I always thought canonical URLs were good, but I’m really not an SEO specialist. I don’t feel that I can say, “I don’t care what your expert said, it’s stupid.” Ya know what I mean?


    Just found this:
    Did exactly what I needed. Again, not sure that it’s a smart thing but there it is.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove canonical link from header’ is closed to new replies.