41
votes
Accepted
Magento 2 How can we get product url with product collection?
$productCollection = $productObj;
Gives from product collection url using loop the collection,
foreach($productCollection as $_product){
echo $_product->getProductUrl();
}
9
votes
Accepted
Magento 2: Setting the product url key with REST API
Although Swagger doesn't specify "url_key", you can add this attribute value by the following method:
{
"product": {
...
"customAttributes": [
{
"attributeCode": "url_key",
...
6
votes
URL Key not changing in Magento 2
The issue resolved with below solution.
As I said url_key was not regenerating only with Migrated Products from Magento 1 to Magento 2 with UB Migration Tool Lite Extension.
At the time of Migrating ...
6
votes
Accepted
Export Product Sku and Product_Url in magento2
I got reference for the answer from this answer and I add addition part to show url_key column, please try this sql query :
SELECT e.entity_id AS 'id',
v1.value AS 'name',
v0.value AS '...
4
votes
How to find duplicate URLs in the database?
To get the Product URL key duplicates. Please check the attached custom script in which the default store view code will be 0 and it will check all the products i.e enable, disable,is_salable, etc. If ...
3
votes
Magento 2 is generating the product url with catalog/product/view/id instead of product name
In case anyone else has this issue, I had the same and the above didn't work for me either. The issue is caused by duplicate url keys being generated from products with the same name. I used this ...
3
votes
Accepted
How can i bulk export Products like sku, products name, request path and Target path
you can export the id, sku, name and request & target paths with this sql:
select e.entity_id, e.sku, ev.value as name, u.request_path, u.target_path
from catalog_product_entity e
inner join ...
3
votes
M2: Is `url_path` used for anything?
url_path is deprecated, and could safely delete its data. I tested it in my Magento 2.3.2.
You could see the deprecated statement in the offical github comment and the graphql-ce codes.
url_path: ...
3
votes
Magento 2 get Product Url in Foreach
Use this code :
=> Using object manager :
$product = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
foreach($product as $_product){
echo $_product-&...
3
votes
Accepted
Magento 2: Issue with Product URL rewrite on Single Store Mode
After so much debugging, I've found an alternative solution for this issue by creating a custom module to generate the URL rewrite while creating/editing a product from Admin.
Create Vendor/...
3
votes
Magento 2 - add prefix before category and products urls
Please check below ways which are working solution to add a prefix before the category and products URLs
https://magecomp.com/blog/how-to-add-prefix-to-store-products-urls-in-magento-2/
Magento 2 .2 - ...
3
votes
301 Redirection from Old Magento2 URLs to SEO-Friendly URLs
You can create 301 redirection for catalog/product/view path url to seo friendly url by below approach.
Step 1: You can override catalog/product/view controller execute method.
Step 2: Then you check ...
2
votes
M2: Is `url_path` used for anything?
"url_path" is used for url rewrites generation. Even in Magento 2.4.
2
votes
Get Product Url return 404
I hope this will help you. It works for me
$products=Mage::getModel('catalog/product')->load($productid);
return $products->getUrlModel()->getProductUrl($products);
2
votes
Accepted
Add a static URL prefix for product and category Magento 2
I found a good solution for this situation!
We need to make our custom module for extending Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator class with plugin methods and Magento\...
2
votes
Magento 2 Get Product Url For Specific Store
From the Magento2 root, you can run below code inside any custom php file.
require './app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$_objectManager = $...
2
votes
Product url displaying category-ID and product-ID
Steps to configuration to remove the category-ID and product-ID
Enable product url by categories in Stores > Configuration > Catalog > Catalog > Search Engine Optimization > Use Categories Path for ...
2
votes
Accepted
Why the Campaign Tracking Parameters isn't working on Product Pages?
In our case the issue was caused by the Creare SEO extension.
Class::function:
Creare_CreareSeoCore_Model_Observer::forceProductCanonical()
Simply setting the creareseocore/defaultseo/...
2
votes
Accepted
Magento 2 .html.html issue after update from Configuration > Catalog
After do many research for this question and can't get any success. I have solved this issue to edit the Model file of /vendor/magento/module-catalog-url-rewrite/ module.
I have overwrite the Catalog ...
2
votes
change the over all product url
You can use product sku value in product "URL Key" field.
Or
You can use an extension for custom product URL. Its free and easy to use.
https://www.magentocommerce.com/magento-connect/catalog/...
2
votes
Some products have catalog/product/view/id/2221/name-of-the-product from product URL magento 2?
Note: Please take a backup of the database
To resolve this issue first delete the rows from the "url_rewrite" table which has 'product' as 'entity_type'.
You can use below query
DELETE FROM `...
2
votes
I WANT TO CREATE TWO URL'S FOR SAME PRODUCT FOR MAGENTO 2
Try this :-
Open admin panel > Marketing > SEO & Search > URL Rewrites > Add URL Rewrites button
Example:-
select Create URL Rewrite -> For Product
Request Path -> skuNo
Target ...
2
votes
Accepted
Multiple URL Rewrites for the same product is SEO issue?
Multiple URLs explanation:
Thanks to Kalvin Klien, as he mentioned in the comment. The Sitemap URLs are crawled by Google.
By default the category path is not added in the product URL as the ...
1
vote
Some products have catalog/product/view/id/2221/name-of-the-product from product URL magento 2?
You can try/use Regenerate a Url rewrites extension.
The extension allows you to regenerate a Url rewrites of products and categories.
1 > Run command to re-generate Url rewrites for all categories/...
1
vote
Magento2: Remove Category path from product URL is not working
You must follow in your admin, Store -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Use Categories Path for Product URLs, you must change to No, and you have to ...
1
vote
Accepted
Magento 2 : Product URL rewrite issue
I have fixed the issue by using this extension
https://github.com/Iazel/magento2-regenurl
Reference: https://magento2-blog.com/magento-2-regenerate-url-rewrites/
1
vote
Accepted
Magento 2.2.2 multillanguage url rewrite
In Admin -> Store -> All Stores, make sure the store view codes are set as English = en and French = fr.
And in Admin -> Store -> Configuration -> General -> Web -> URL Options -> Add store ...
1
vote
Magento 1.9.2.1 Product Upload Via .csv file does not generate url rewrites
url_key is not a mandatory attribute. Magento will assume the product's name (with some preg_replace) if not specified.
This means, if your product name is for example "Test Test" your initial url_key ...
1
vote
How to export product url in Magento2
You can use SQL for import.
For example, in eav_attribute you can find attribute_id for product url_key. Default value is 126
Further, you may use this SQL:
SELECT
catalog_product_entity.entity_id,...
1
vote
Magento v1.9.x ultimate module creator entity URL rewrite / key problem
This module might help you https://github.com/vladsmirnov/url-rewrites. I have used it in one of my projects. It helped in reducing the duplicates while reindexing.
Please run the shell script in the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
product-urls × 183url-rewrite × 70
magento2 × 57
url × 43
magento-1.9 × 29
url-key × 20
product × 14
magento2.3 × 11
magento-1.7 × 10
category × 9
seo × 8
magento-2.1 × 7
products × 7
redirect-url × 7
magento-enterprise × 6
301-redirect × 6
import × 5
store-view × 5
catalog-url-rewrite × 5
php × 4
magento-1 × 4
product-attribute × 4
duplicate × 4
canonical × 4
magento-1.8 × 3