Which magento table contains product url slug

Which magento table contains product url slug

July 31, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Which magento table contains product url slug

Solving Magento Product URL Slug Issues

When working with Magento, especially when using import tools like Magmi, you may face issues related to product URLs and their slugs. This blog post will guide you through identifying and managing these slugs directly in your MySQL database.

Understanding the Magento Database Structure

Magento is built on top of a relational database management system (RDBMS), with the primary data stored in tables within your server’s MySQL instance. To manage product URLs, we need to understand which table contains this information.

Identifying the Relevant Table: catalog_product_entity

The core table that stores most product-related data is called catalog_product_entity. This table holds a significant amount of metadata for each product in your catalog, including its URL key (slug).

Here’s a simplified structure:

CREATE TABLE `catalog_product_entity` (
  `entity_id` int(10) unsigned NOT NULL auto_increment,
  // Other columns...
  `url_key` varchar(255) NULL DEFAULT NULL,
  PRIMARY KEY (`entity_id`)
);

Accessing the URL Key (Slug)

To access or modify the slug for a specific product, you can query this table directly. Let’s assume your website has an ID of ‘10’ and the product you’re looking at has an ‘entity_id’ of ‘5’.

SELECT url_key FROM catalog_product_entity WHERE entity_id = 5 AND store_id = 10;

This query will return the current URL key (slug) for that particular product.

Modifying the Slug Directly

If you want to change a slug directly, you can update this table:

UPDATE catalog_product_entity SET url_key = 'new-slug' WHERE entity_id = 5 AND store_id = 10;

This will set the new URL key for that product. However, remember these changes are permanent and can affect your site’s SEO if not handled carefully.

Best Practices: Using Magento’s API

While directly updating the database is possible, it’s recommended to use Magento’s built-in APIs or the provided admin interface whenever feasible. This ensures compatibility with future updates and maintains a clean data structure.

For Magmi imports specifically, consider using the ‘sku’ field as an identifier when mapping your CSV files to the url_key column in the import script.

Conclusion

Managing product URLs and slugs is a crucial part of e-commerce development. Whether you’re using tools like Magento or Magmi for your product management, understanding the underlying database structure can help solve issues efficiently.

Remember, while direct database edits are possible, they should be used sparingly and with caution, especially when there’s an API available to perform the same task.

For more advanced Magento development needs, consider reaching out to professionals at Laravel Company, where our experts can help optimize your e-commerce platform for maximum performance and security.

Catalog Database Import/Export SEO

Our network