How to remove the "-en" (language code) from the SEO name for records in CS-Cart. Print

  • 3

If you are one of those users frustrated by the mysterious reappearing "-en" characters in your SEO name entries in CS-Cart, then you should find this article helpful.

Let's start by explaining how the "-en" is used in CS-Cart.
First of all, this discussion only applies if the SEO add-on for CS-Cart is enabled in Administration --> Add-Ons. CS-Cart adds a language code to the URL being displayed based upon the SEO add-on settings. To eliminate the appearance of the language code in your store's URLs, use the following settings for this add-on:

Use single URL for all languages = checked
Show language in the URL = unchecked

Next, we need to discuss data entry for languages. If there is more than one language, even if one of the languages was disabled, if the SEO name is the same for an entry in both languages, it will cause it to add the language code to the SEO name when you go to save it, even if you have it configured not to display it in the storefront. If you are not using lanuages, they should be removed/deleted in Administration --> Languages --> Languages tab

Finally, CS-Cart stores SEO names for all record types in the same table (cscart_seo_names). This applies for: products, categories, features (when a feature uses the "Extra" data entry field for SEO name), pages, and any records with an SEO name entry. When entering an SEO Name, if the entry matches the seo-name for another record type, CS-Cart will automatically add an -en to the SEO Name. If there are multiple duplicates, CS-cart will also append indexed numbers after the -en string.

Example:

thorlo-hiking-socks-thick-padding-mens-kx-en
thorlo-hiking-socks-thick-padding-mens-kx-en-2
thorlo-hiking-socks-thick-padding-mens-kx-en-2-3
thorlo-hiking-socks-thick-padding-mens-kx-en-2-3-4

This is done to prevent duplicates, which, if existed, would prevent CS-Cart from finding the proper record match when the that URL were requested. Since for most stores, your category and product URLs will take priority over any other URL types, you will want to fix those SEO names AFTER correcting the other record types that are causing a duplicate (and resulting in the added -en in the SEO name).

The simplest method of finding these "bad" SEO name entries is going to your database management tool (ie: phpMyAdmin) and running the following query against your CS-Cart database:

SELECT *
FROM `cscart_seo_names`
WHERE `name` LIKE '%-en%';

In the results, you will see all of the records containing the -en entries for SEO name. Below are is a lookup table for the "type" column so that you will know where to find these records in CS-Cart.

a = seo name for pages
m = seo name for supplier
e = seo name for product feature extended
c = seo name for category
p = seo name for products

For any of the record types that you do not want to contain an "-en" in the SEO name, you will then need to first go to and edit each of the SEO names for the other records (the ones that are duplicated elsewhere) and change them to something else, adding some extra character or number. Then you can go in and edit the record with the "-en" and remove the "-en" from the SEO name.

If you have a large number of records with an "-en", the easiest and fastest way to do a bulk edit of these values is to do an export/import. PROCEED WITH CAUTION!!! There cannot be any duplicates in the "name" column in the file upon import or this may cause CS-Cart to not properly load those URLs when requested by visitors browsing the site.

  1. Login to your database management tool (ie: phpMyAdmin)
  2. Run the following query:
    SELECT *
    FROM `cscart_seo_names`
    ORDER BY `cscart_seo_names`.`name`ASC
  3. Export the results to a CSV file, including columnn headers in the first row.
  4. Edit the file in EXCEL or another spreadsheet program, MAKING SURE that each name column value is unique.
  5. Save the file.
  6. Import the file to the "cscart_seo_names" table using your database management tool.
  7. Done!

Was this answer helpful?

« Back