Title: Programmatically Set Default Expiry
Last modified: April 8, 2020

---

# Programmatically Set Default Expiry

 *  [Phill Healey](https://wordpress.org/support/users/munklefish/)
 * (@munklefish)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/programmatically-set-default-expiry/)
 * Hi,
 * I’m trying to programmatically set the default expiry data by trying to update
   the data in the options table. Unfortunately, the info isn’t updating and I’ve
   no idea why.
 * Here’s my code:
 *     ```
       $metaDefaultSerial = array(
       		'auto_expire_registered_users' => /*$old_expire_data['auto_expire_registered_users']*/ 'Y',
       		'expire_user_date_type' => 'on', //ensure we use our custom date
       		'expire_user_date_in_num' => /*$old_expire_data['expire_user_date_in_num']*/ '365',
       		'expire_user_date_in_block' => /*$old_expire_data['expire_user_date_in_block']*/ 'days',
       		'expire_timestamp' => strtotime($acf_expireDate), //set our custom date based on current date
       		'expire_user_role' => 'subscriber', //ensure old members all get same role
       		'expire_user_email' => /*$old_expire_data['expire_user_email']*/ 'Y',
       		'expire_user_email_admin' => /*$old_expire_data['expire_user_email_admin']*/ 'Y',
       		'expire_user_reset_password' => 'N',
       		'expire_user_remove_expiry' => 'Y'
       	);
       	//deactivate_plugins( 'expire-users/expire-users.php', 1, 0 );
       	update_option('expire_users_default_expire_settings', $metaDefaultSerial);
       ```
   
 * Any idea why this isn’t working? The date never changes and the other fields 
   don’t appear to be taking effect. When I go to create a new user the date option
   always appears as 1 week from now.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Phill Healey](https://wordpress.org/support/users/munklefish/)
 * (@munklefish)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/programmatically-set-default-expiry/#post-13015241)
 * bump..

Viewing 1 replies (of 1 total)

The topic ‘Programmatically Set Default Expiry’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/expire-users_669999.svg)
 * [Expire Users](https://wordpress.org/plugins/expire-users/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/expire-users/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/expire-users/)
 * [Active Topics](https://wordpress.org/support/plugin/expire-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/expire-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/expire-users/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Phill Healey](https://wordpress.org/support/users/munklefish/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/programmatically-set-default-expiry/#post-13015241)
 * Status: not resolved