1. WooCommerce Product Table
  2. Advanced Usage

Adding a 'Date Modified' column to the product table

The WooCommerce Product Table WordPress plugin lists your products in a table or one-page order form. You can choose which columns to include, including a date column containing the date when the post was published. While it doesn't come with a 'Date modified' column, we have provided a code snippet which will add a column containing the date when the product was last updated.

WordPress posts display modified date
A product table with a custom 'Last Updated' column.

Please note that this code is aimed at developers and if you don't know how to use it, then we recommend posting a job on Codeable. We have partnered with Codeable to provide customizations for our plugins.

We've partnered with Codeable to provide our customers with expert help if required.

How to set it up

1. First, add modified_date to your list of columns

Once you have installed WooCommerce Product Table, you need to include modified_date in the list of columns.

For example, if you are setting the columns directly in the shortcode (instead of on the plugin settings page) then you might add:

[product_table columns="image,name,modified_date,buy"]

The column header will say 'Modified date'. You can easily change this using these instructions.

2. Use code snippet to add a custom column

Next, you need to use the following code snippet to create a custom column containing the product last modified date:

   function () {
      class Product_Table_Data_Modified_Date extends \Barn2\Plugin\WC_Product_Table\Data\Abstract_Product_Data {

         public function __construct( $product ) {
            parent::__construct( $product );

         public function get_data() {
            // Retrieve the product's modified date.
            $datetime = $this->product->get_date_modified();

            // Format the modified date - set your own format here if required.
            $modified_date = $datetime ? $datetime->date( 'F j, Y' ) : '';

            // Return the modified date.
            return apply_filters( 'wc_product_table_data_modified_date', $modified_date, $this->product );


         function ( $data_obj, $product, $args ) {
            return new Product_Table_Data_Modified_Date( $product );
         }, 10, 3


This code snippet can be added to your theme's functions.php file or you can add it to a custom plugin.

Again, if you don't know how to use the code snippet then you should ask your developer or Codeable:

We've partnered with Codeable to provide our customers with expert help if required.

How to create a table listing recently updated products

To create a table that only lists products that have been recently updated, then you would need to:

  • Follow the above instructions and order the table by the modified date in descending order, and;
  • Use the product limit option to set a product limit.

For example, if you wanted to show the 10 most recently updated products then you would set a product limit of 10.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.