Bulk Change Expiration Dates

Note: This requires PW WooCommerce Gift Cards Pro.

The wp_pimwick_gift_card table stores the expiration date for the gift cards. Use phpMyAdmin to run SQL scripts to mass update the expiration date in the database.

 

To set the expiration date to 1 year from the create date

First, run this preview query so you can make sure things look as expected:

SELECT *, DATE_ADD( create_date, INTERVAL 365 DAY) AS 'new_expiration_date' FROM wp_pimwick_gift_card;

This query will perform the update:

UPDATE wp_pimwick_gift_card SET expiration_date = DATE_ADD( create_date, INTERVAL 365 DAY);

 

To extend all expiration dates by 1 year.

First, run this preview query so you can make sure things look as expected:

SELECT *, DATE_ADD( expiration_date, INTERVAL 365 DAY) AS 'new_expiration_date' FROM wp_pimwick_gift_card;

This query will perform the update:

UPDATE wp_pimwick_gift_card SET expiration_date = DATE_ADD( expiration_date, INTERVAL 365 DAY);

Be sure to make a database backup before running any update queries.

Skip to content