Magento 2 SEO Unique Catalog URLs

Installation and User Guide for Magento 2 SEO Unique Catalog URLs

Table of Contents

  1. Installation
    • Installation via app/code
    • Installation via Composer
  2. Configuration Settings for SEO Base
    • General Settings
  3. Configuration settings for Catalog URL
    • General Settings
    • Configuration Path to Set Up Primary Category
    • Primary Category settings for Category
    • Run the script to setup primary category of one or all products together
  4. Set Primary Categories
  5. Front-end Site View
    • Product Page Unique URL
    • Search Page / Category Page Unique Catalog Product URL

Installation

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer

Configuration Settings for SEO Base

Go to Admin > Stores > Configuration > Scommerce Configuration > SEO Base

General Settings

image.png

Configuration Settings for Catalog URL

Go to Admin > Stores > Configuration > Scommerce Configuration > Catalog URL

General Settings

image (1).png

Configuration Path to Set Up Primary Category

Go to Admin > Catalog > Select Product > Search Engine Optimization > Primary Category . The drop down will show all the categories selected for the product from where you can select the primary category of the product.

image.jpg

Primary Category settings for Category

Go to Admin > Catalog > Categories > Select Category > Primary Category Settings. The drop down will show two primary category settings for the selected category: -

image (4).png

Run the script to setup primary category of one or all products together

We have included a PHP script that can be utilized to set primary category for one or all products together. Simply run the script in the url and the primary categories will get updated for the set products.

{{Website_URL}}/SetPrimaryCategoryM2.php?deleteSku s=MH01

image (1).jpg

{{Website_URL}}/SetPrimaryCategoryM2.php?deleteSkus=all

image (2).jpg

If the script doesen't work in the URL then make sure to place the script inside PUB directory and change line number 6 as follows:-

image.png

Once updated, please run the script again.

Set Primary Categories

You can use a script provided with the extension to automatically add primary categories for products. Admin can exclude certain categories from primary category and also prioritise one category over the other to be picked as the primary category.

Go to Admin>Catalog>Categories select a category then scroll down to find the option "Primary Category Settings". Here click on "Exclude From Primary Category" to exclude this category from primary category or enter the priority 0 being the highes. The highest priority category will be picked first for the primary category.

image (3).png

N.B - Run the script provided in the extension folder at the path Data/SetPrimaryCategoryM2.php from ssh

Front-end Site View

image (3).jpg

image (4).jpg

If you have a question related to this extension please check out our FAQ Section first. If you can't find the answer you are looking for then please contact support@scommerce-mage.com.




Revision #6
Created 22 April 2025 12:37:24 by Admin
Updated 28 October 2025 07:56:19 by scommerce