asprada / magento2-module-rebuild-url-rewrite
Magento 2 module to rebuild url rewrites for categories, products and cms.
Installs: 9 872
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 9
Open Issues: 0
Type:magento2-module
Requires (Dev)
- codeclimate/php-test-reporter: 0.4.0
- phpunit/phpunit: ~6.2.0
README
The module adds a CLI which allows to rebuild the following URL Rewrites: categories
, products
and cms-pages
.
It's a fork from Stämpfli repository with some improvements to:
-
Multiple root category ID for Magento 2 Multistore.
Now when you rebuild categories' urls for specified store with a custom category root ID the correct urls are generated.
-
Use SEO configurations fro Admin Panel for products.
Now the configuration option
Use Categories Path for Product URLs
is included during rebuilding products' urls.When set to
No
the produtct urls with subcategories in itspath
will not be stored in theurl_rewrite
table.It's for the performance purpose. It prevent from generating unused urls and the table has less entries for quicker SQL queries.
Configuration option path:
Admin Panel > Stores > Settings > Configuration > Catalog > Catalog > Search Engine Optimization > Use Categories Path for Product URLs
Installation
Install the module with composer:
composer require asprada/magento2-module-rebuild-url-rewrite
Usage
Rebuild everything.
bin/magento urlrewrite:rebuild categories,products,cms-pages
Rebuild only categories
bin/magento urlrewrite:rebuild categories
Rebuild only products
bin/magento urlrewrite:rebuild products
Rebuild only cms-pages
bin/magento urlrewrite:rebuild cms-pages
Rebuild only specific categories
bin/magento urlrewrite:rebuild categories -c=25,26,27
or products
bin/magento urlrewrite:rebuild products -p=1,2,3
Rebuild only specific stores
bin/magento urlrewrite:rebuild categories -s=1,2
Any combination is possible.
See --help
for more information
bin/magento urlrewrite:rebuild --help
Requirements
- PHP: 7.0.x | 7.1.x
- Magento 2.1.x | 2.2.x
Support
If you have any issues with this extension, open an issue on GitHub.
Contribution
Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.