Thursday, November 4, 2010

PrestaShop Tips - How to fix duplicated product SEO friendly URL issue

At Catalog management page of PrestaShop Back office, you can duplicate a product from existing product to create new similar products. This is a good feature/function.

But there is one problem with this feature. If you enable SEO friendly URL at your store, you will find that friendly URL of the new duplicated product is using previous product name.

For example, if you duplicate a product from "Desktop Computer" with id=10 to create a new product "Laptop computer" with id=11. Then the SEO friendly URL of new product will be something like "..../11-Desktop-Computer" instead of "11-Laptop-Computer".

Even you rename the new created product, the friendly URL does not update/change. There is no place at Back Office to change SEO friendly URL for each product. The only way you can fix the problem is to change data in database directly.

Here is how to fix the problem
1. Find the id of product that you want to change for at table ps_product
2. Find the record with same id_product at table ps_product_lang table
3. Change link_rewrite field of this record to the name you want it be.
For example, in above sample, you will need to change "Desktop Computer" to "Laptop Computer" for the record with id_product=11
4. After change all records, try to re-generate .htaccess
(Back office - Preference - Friendly URL section

2 comments:

Juan Guirao said...

Hi Alvin,
Thanks for the tutorial. I am going to use this valuable information.

I do have a question though: It is possible that Google indexed the old SEO friendly URL and now it will find "duplicate content" because there are two URL pointing to the same page and no 301 redirection.

My question is: how to add a 301 redirection that works in this case?

Juan

Juan Guirao said...

Hi Alvin,
Thanks for the tutorial. I am going to use this valuable information.

I do have a question though: It is possible that Google indexed the old SEO friendly URL and now it will find "duplicate content" because there are two URL pointing to the same page and no 301 redirection.

My question is: how to add a 301 redirection that works in this case?

Juan