WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove canonical link from header (6 posts)

  1. tshirtfiend
    Member
    Posted 4 years ago #

    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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    	<head profile="http://gmpg.org/xfn/11">
    		<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" />
    		<![endif]-->
    
    		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    		<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    		<?php
    			wp_enqueue_script("jquery");
    			wp_head();
    		?>
    		<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.

  2. 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.

  3. tshirtfiend
    Member
    Posted 4 years ago #

    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.

  4. 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: http://www.mydigitallife.info/2010/01/24/how-to-disable-wordpress-canonical-url-or-permalink-auto-redirect/

    Should help you.

  5. tshirtfiend
    Member
    Posted 4 years ago #

    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='http://www.website.com/' />
    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?

  6. tshirtfiend
    Member
    Posted 4 years ago #

    Ah!

    Just found this:
    http://pixelpunk.co.uk/2010/01/disable-wordpress-built-in-canonical-url/
    Did exactly what I needed. Again, not sure that it's a smart thing but there it is.

Topic Closed

This topic has been closed to new replies.

About this Topic