A
A
Anton Seredny2017-06-23 22:14:29
Search Engine Optimization
Anton Seredny, 2017-06-23 22:14:29

Duplicate url of product categories, how to remove?

There are two urls that open the same page

http://site.ru/product-category/stoly/obedennye_stoly/obedennye_derevyannye_stoly/
http://site.ru/product-category/obedennye_derevyannye_stoly/

I don't need such duplicates, even though the canonicals are spelled correctly... How can I make the page from the example show only 1 url. There are a lot of similar urls, you can’t manually drive them in

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
WordPress WooCommerce, 2017-06-24
@smidl

You can do a 301 redirect with the template_redirect hook. It is only necessary to correctly describe getting the current term, then get_term_link() and wp_redirect().

J
Julia Reiner, 2017-06-26
@SandFox0

In your case, it's better to take care of setting the canonical pages rel="canonical".

A
Ales Mikhnevich, 2017-06-28
@Sasha_plus

I was doing then url without a parent category, this is how it is implemented on many sites. For example Wildberries. It turns out that one page will be available from different sections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question