![]() | | ||||||||
| | #1 |
| HyperActive Warrior Join Date: Jul 2010
Posts: 158
Thanks: 17
Thanked 1 Time in 1 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. |
| | |
| | #2 |
| HyperActive Warrior Join Date: Aug 2010
Posts: 112
Thanks: 7
Thanked 17 Times in 17 Posts
|
why avoid canonical plugin ? it is easier than coding the header.php |
| | |
| | |
| | #3 |
| HyperActive Warrior Join Date: Jul 2010
Posts: 158
Thanks: 17
Thanked 1 Time in 1 Post
|
The less plugins the better unless I absolutely need it is my thought process.
|
| | |
| | #4 |
| SEO Ninja War Room Member Join Date: Apr 2011 Location: Australia
Posts: 127
Thanks: 31
Thanked 23 Times in 16 Posts
|
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! | |
| | |
| | #5 | |
| Warrior Member Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
<?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 '">'; ?> | |
| | |
![]() |
|
| Tags |
| canonical, plugin, urls, wordpress |
| Thread Tools | |
| |
![]() |