How to Get All Product URLs in Magento 2

The admin can create six different types of products in Magento 2 store and each time a product is created, a unique URL is created for that product page.
In all such scenarios, follow the programmatic solution given below to get all product URLs in Magento 2.
Something went wrong.
Thank You.
That’s it.
Hence, I have posted a programmatic solution to get all product URLs in Magento 2 store.
Also, a store owner may maintain and update such a product list from time to time to monitor the store expansion and product performance.

Steps to Get All Product URLs in Magento 2

  1. Create registration.php at Vendor/Module.
  2. Create module.xml at Vendor/Module/etc.
  3. Create ProductPageUrls.php at Vendor/Module/Helper.

Using this solution, one can get all product URLs and use them while updating the product data, creating HTML sitemap for navigation purpose or simply track the URLs of the store.
I would be happy to help.
Now, when you are working with HTML sitemap in your Magento 2 store, you might need the list of all these product URLs. Manually creating this list is a tedious process and prone to error.
Never miss Magento tips, tricks, tutorials, and news.
Feel free to share the solution with Magento Community via social media.

Get Weekly Updates

Thank you for subscribing.

If you have any doubts regarding this post, just mention them in the Comments section below.
Note: You might also find the solution to get all category URLs in Magento 2 helpful if you are creating HTML sitemap and landed to my post!




(based on 1 Reviews)