17

I'm using WooCommerce on a WordPress and it adds product & product-category to the URLs. http://dev.unwaveringmedia.com/8dim/product-category/all-party-supplies/ http://dev.unwaveringmedia.com/8dim/product/14-snowman-serving-tray/

I need to remove 'product' & 'product-category' from the URLs. Is there any way to modify the permalinks and remove them?

Irfan
  • 4,882
  • 12
  • 52
  • 62

2 Answers2

3

Its good practice for SEO and UX to have a product category base. Product category bases help to distinguish products from posts. I usually change the product category base to "our-products" or "products".

To do this go to settings->permalinks-> enter your desired product category base.

rhysclay
  • 1,645
  • 3
  • 22
  • 42
  • 1
    I can understand being good for UX (the user can tell it is a cat easily) but how is it good practice for SEO? – ejntaylor Apr 26 '15 at 12:45
  • My theory is that it demonstrates a clear heirachy for your custom post types, to a crawler website/our-products/product1 & website/our-products/product2 shows a distinct relationship. Anecdotely optimised indexing and clear permalink structure has boosted my clients rankings. – rhysclay Jun 15 '17 at 10:37
  • Why the hell one should care of the type of page he's on (ex: a category or a post)? IMO it's thousand times more important to keep a logic and concordant permalink structure, ex: If I'm on a product here `http://example.com/tshirts/a-tshirt`, anybody would understand `tshirts` is the category and I'd expect landing on this category when I remove the trailing part of this URL... If you have a category/product base, you can't do that. For Google, it helps understand better the site structure and don't dilute keywords weight in URL with a useless and ugly base in the permalink structure. – ClemC Aug 28 '18 at 18:07
  • One segment of URL `/somepage/` should be a page, as much for ergonomy as for SEO. Including bases in your permalink structure goes all the way against that principle... This permalink structure base concept is implemented only to "help" users avoiding conflicts in their system, believing they can't handle that themself... Your argument is the one that the implementors of this concept give to their users to legitimate it more. It's NOT an SEO argument. I believe SEO and ergonomy is more a priority for system owners and can understand what they're doing if we explain to them... – ClemC Aug 28 '18 at 18:12
  • Remember it's not to end-users to adapt to the system and system admins but to the system and system admins to adapt to end-users... This permalink base is only a systemic concept. – ClemC Aug 28 '18 at 18:37
  • rhysclay, you say: *My theory is that it demonstrates a clear heirachy for your custom post types, to a crawler `website/our-products/product1` & `website/our-products/product2` shows a distinct relationship.* Shouldn't be `/our-products/` a category page? With such a base (which should be a real page) there is no hierarchy since a base is NOT a page. You seem to agree that a crawler can understand your site structure following the permalink structure, so what happens if the crawler try to access to the base in that permalink structure or if it considers a non existing page as a parent page? – ClemC Aug 28 '18 at 19:20
  • Crawlers care about real content, not uninterpretable semantic bases in URL distorting your site structure/hierarchy. If you want a clear hierarchy make `/our-products/` a category page and not a base... There's no need ever of a base not being a real page listing its children in the permalink hierarchy... The only reason of this concept is systemic as stated earlier. – ClemC Aug 28 '18 at 19:41
0

There is an official answer to this in the WooCommerce documentation.

A snippet:

Unfortunately this is not possible due to the way WordPress resolves its URLs. It uses the ‘product-category’ (or any other text for that matter) base of an URL to detect that it is an URL leading to a product category.

There is a bit of followup explanation, and allegedly there are some plugins that make it possible, though it's not recommended.

You may also be able to 'hack' the core code and just change the strings they use for that permalink structure -- or maybe that's what the elsewhere-mentioned setting is intended to do?

anonymous coward
  • 12,594
  • 13
  • 55
  • 97