Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-11-2011, 08:19 AM   #1
HyperActive Warrior
 
Join Date: Jul 2010
Posts: 158
Thanks: 17
Thanked 1 Time in 1 Post
Default How to Use Canonical URLs in WordPress (without a plugin)?

I understand how to use canonical urls on a static HTML based site, but I don't understand where to include these URLs on a WordPress based site.

They go in the head tags of the URLs of the pages with duplicate content... but I only have access to the files of my theme... so I'm a bit lost as to how to access the head tags for those URLs to input the code.
trentonlaura is offline   Reply With Quote
Old 09-11-2011, 08:34 AM   #2
HyperActive Warrior
 
Join Date: Aug 2010
Posts: 112
Thanks: 7
Thanked 17 Times in 17 Posts
Default Re: How to Use Canonical URLs in WordPress (without a plugin)?

why avoid canonical plugin ?
it is easier than coding the header.php

phoenikz is offline   Reply With Quote
Old 09-11-2011, 11:11 AM   #3
HyperActive Warrior
 
Join Date: Jul 2010
Posts: 158
Thanks: 17
Thanked 1 Time in 1 Post
Default Re: How to Use Canonical URLs in WordPress (without a plugin)?

The less plugins the better unless I absolutely need it is my thought process.
trentonlaura is offline   Reply With Quote
Old 09-11-2011, 12:48 PM   #4
SEO Ninja
War Room Member
 
chenkev's Avatar
 
Join Date: Apr 2011
Location: Australia
Posts: 127
Thanks: 31
Thanked 23 Times in 16 Posts
Contact Info
Send a message via Skype™ to chenkev
Default Re: How to Use Canonical URLs in WordPress (without a plugin)?

I'm not sure but doesn't wordpress do this automatically now? In the settings page (I think it's called settings) it should have a website URL field. Is this for canonical url?

---> From $0 to $200 a Day with EASY Google Rankings <---
WSO Special DIMSALE
-----> EXTREMELY Low Competition Keywords with HIGH Traffic+CPC <-----
Brand New AdSense Site with Only TWO Posts Makes $10/Day!
chenkev is offline   Reply With Quote
Old 10-14-2011, 08:14 PM   #5
Warrior Member
 
Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: How to Use Canonical URLs in WordPress (without a plugin)?

Quote:
Originally Posted by trentonlaura View Post
I understand how to use canonical urls on a static HTML based site, but I don't understand where to include these URLs on a WordPress based site.

They go in the head tags of the URLs of the pages with duplicate content... but I only have access to the files of my theme... so I'm a bit lost as to how to access the head tags for those URLs to input the code.
Place this in the header:

<?php
foreach((get_the_category()) as $cat);
echo '<link rel="canonical" href="';
if(is_home() || is_front_page()) {
echo bloginfo('url');
echo '/';
} elseif(is_single() || is_page()) {
echo the_permalink();
} elseif(is_category()) {
echo bloginfo('url');
echo '/';
echo $cat->category_nicename;
echo '/';
} elseif(is_tag()) {
echo get_tag_link($tag_id);
} else{}
echo '">';
?>
sparrokei is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum

Tags
canonical, plugin, urls, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 09:59 AM.