Show product creation & last edit dates on Frontend in Magento

Show product creation & last edit dates on Frontend in Magento

July 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Show product creation & last edit dates on Frontend in Magento

Displaying Product Creation & Last Edit Dates on Magento Frontend

As an experienced developer, I often encounter requests like this from clients using Magento for their e-commerce platforms. The database holds valuable information about when products were created and last updated, but it’s not immediately visible on the frontend. Let me walk you through the process of exposing these dates to your customers.

Understanding the Database Schema

Magento stores product creation and update timestamps in the catalog_product_entity table. You can find them under the columns created_at and updated_at, respectively, which are of type datetime. These fields hold the date-time when a product was first added to the catalog or last modified.

SELECT *
FROM catalog_product_entity
LIMIT 1;

Exposing Timestamps in Product View

To display these timestamps on the frontend, you’ll need to modify your theme’s product view template. Here are the steps:

  1. Access Your Theme Directory Open your Magento installation and navigate to the directory of your active theme (usually under app/design/frontend/[Vendor]/[Theme]).

  2. Locate the Product View Template The core file responsible for displaying basic product information is catalog_product_view.xml. You can find it in the layout folder of your theme.

  3. Add the Timestamps Block Open catalog_product_view.xml and add a new <block> element inside the <referenceContainer name="content"> container. This block will be responsible for rendering the timestamps.

    <block class="Magento\Catalog\Block\Product\View" name="product.info.created_at" template="Magento_Catalog::product/view/created_at.phtml">
        <arguments>
            <argument name="view_model" xsi:type="object">Magento\Catalog\Model\Product\View\Config</argument>
        </arguments>
    </block>
    
  4. Create the Template File Create a new file named created_at.phtml inside the product/view/ directory of your theme. This is where you’ll place the PHP code to render the dates.

  5. Write the PHP Code

    Open created_at.phtml and add the following code:

    <?php if ($block->getProduct()->getCreatedAt()): ?>
        <div class="product-created-at">
            <strong><?= __('Created:') ?></strong>
            <?= $block->formatDate($block->getProduct()->getCreatedAt(), 'short') ?>
        </div>
    <?php endif; ?>
    
    <?php if ($block->getProduct()->getUpdatedAt()): ?>
        <div class="product-updated-at">
            <strong><?= __('Last Updated:') ?></strong>
            <?= $block->formatDate($block->getProduct()->getUpdatedAt(), 'short') ?>
        </div>
    <?php endif; ?>
    

    This code uses Magento’s built-in date formatting function formatDate() to display the dates in a short format (e.g., “M d, Y”).

  6. Apply CSS Styling

    To style these new blocks, you can use your theme’s CSS or add custom styles specific to this template. You might want to place them near the product description or pricing.

Conclusion

Displaying product creation and update dates on the Magento frontend adds transparency for customers and can be a useful feature for certain business models. By following this guide, you should now know exactly how to expose these timestamps in your store’s catalog pages.

Remember, it’s always best practice to make changes like this in a child theme or using a plugin, rather than modifying core files directly, as this keeps the updates separate from Magento’s core files and makes maintenance easier.

For more advanced customizations or if you’re looking to implement similar features on your e-commerce platform, feel free to reach out to us at Laravel Company.

Happy coding!

Catalog Database Themes Customers

Our network