admin管理员组

文章数量:1194361

I created a post which is assigned to multiple categories.

Eg: I have a post "My Post", and I put it in "foo" and "bar" categories.
Now my article will have two permalinks, "/foo/my-post" and "/bar/my-post".
Google calls this a duplicate, which it considers to be spam, hence this is not what I want.

How can I use multiple categories but have the same permalink?
I want this only for SEO.

My current permalink structure is /%category%/%post_id%-%postname%.html

I created a post which is assigned to multiple categories.

Eg: I have a post "My Post", and I put it in "foo" and "bar" categories.
Now my article will have two permalinks, "/foo/my-post" and "/bar/my-post".
Google calls this a duplicate, which it considers to be spam, hence this is not what I want.

How can I use multiple categories but have the same permalink?
I want this only for SEO.

My current permalink structure is /%category%/%post_id%-%postname%.html

Share Improve this question edited Jul 17, 2013 at 8:42 Johannes Pille 11.1k3 gold badges42 silver badges53 bronze badges asked Jul 17, 2013 at 5:58 ITChristianITChristian 3161 gold badge3 silver badges12 bronze badges 8
  • 2 how are you outputting two different permalinks for the same post? this is not default behavior. WordPress generates a single permalink using the category with the lowest ID. – Milo Commented Jul 17, 2013 at 6:01
  • 2 Your article will have just one permalink. – fuxia Commented Jul 17, 2013 at 6:01
  • but why my article is visible at "/foo/my-post" and "/bar/my-post" ? – ITChristian Commented Jul 17, 2013 at 6:03
  • Google say that if will find same content at two different urls on the same site, it will consider it as duplicate => spam... – ITChristian Commented Jul 17, 2013 at 6:04
  • 1 okay, but categories foo and bar are visible and shows list of aticles... so category foo links to permalink with foo/ and category bar links to permalink with bar/ – ITChristian Commented Jul 17, 2013 at 6:35
 |  Show 3 more comments

2 Answers 2

Reset to default 1

If you are using category name in permalink for a post, it's not a good practice, especially, if you have two or more categories per post.

Solutions: Use canonical link tag for the post and add it to your prefered absolute URL. Google will rank only this one and it won't be as duplicate content.

It can't generate 2 URLs for a single post. If not specified otherwise will probably take the variable /category/ from your first category. Not duplicate content.

This is a common Wordpress behavior. I'm seeing this on most of the websites I've published with that URL structure - /%category%/%post_id%-%postname%.html

I have also read your comment, and if your post shows with different URLs, although unlikely, there's something wrong with your setup.

本文标签: Multiple post categoriessingle permalink