Rel=canonical and WordPress
October 10, 2013 10:28 AM   Subscribe

You have two sites - site1.com and site2.com. Site1 has been around for years, and you've merged it with another site to become site2.com. Site1.com has accumulated years worth of links, backlinks, domain authority, and so on - and you want to pass that one to site2.com in the best way possible. More inside, naturally.

So I've basically combined two travel websites to make a single website going forward long-term. Site1.com was, at one point, a PR4, so this isn't merely a question for the academics. Everything's setup to send site1.com/blogpost to site2.com/blogpost automatically (thank you, htaccess!), but there's bound to be something else out there.

The main goal is to pass as much of the link juice onto site2.com as possible, thus the rel=canonical question. How would you implement this in WordPress, or if that isn't the solution, what else would you do? SEO plug-ins are configured and forwarders set - what's next?
posted by chrisinseoul to Computers & Internet (4 answers total)
 
Your forwarders should be using HTTP status code 301, moved permanently, rather than 302, which indicates a temporary move. If they're using 301 you should be all set.
posted by kindall at 11:15 AM on October 10, 2013


Best answer: kindall is right on the money that the 301 redirect does the lion's share of the work here. If you want to set up rel=canonical in WordPress, I think you just set up the tag in whichever php template includes the head tags (usually header.php and any special templates you've got that override it) and snag the current URL by php magic to stick in the canonical tag. At least that makes intuitive sense, but I haven't done a WordPress project in a while.
posted by jason_steakums at 10:31 PM on October 10, 2013 [1 favorite]


Response by poster: 301 redirects are all set, and I was hoping that would be the case. I'll admit to still being a bit confused by rel-canonical tags, but that link looks to take the cake. Thanks Jason :)
posted by chrisinseoul at 2:25 AM on October 11, 2013


Google has information on using rel="canonical" cross-domain here: Handling legitimate cross-domain content duplication.

And I believe you'd simply do something like:
<?php
$some_condition = is_page(); // for this example, just show this for "pages"
if ($some_condition):
	$permalink = get_permalink();
	$new_permalink = str_replace("site1.com", "site2.com", $permalink);
?><link rel="canonical" href="<?php echo $new_permalink; ?>" /><?
endif;
?>
... assuming I'm understanding what you're trying to do.
posted by artlung at 4:34 PM on October 11, 2013 [1 favorite]


« Older Trailer brake controller   |   It Never Rains In Southern California Newer »
This thread is closed to new comments.