Support » Plugin: Expire Users » Expiration settings not applied automatically to new users thru Gravity Forms

  • Not sure if anyone else has run into this but here goes —

    I have a Membership site that sells one year memberships. I am using Gravity Forms with the User Registration Add-On to create a new user once someone buys a membership. I have a hidden field in that form that populates the expiration date for the new user. All of that is working fine. However, when I go into the new user account, NONE of the settings I have specified in the Expire User settings page are being applied automatically.

    I have checked the box for “Automatically set expiry date for new users who register via the registration form.” Expiry Date is set for one year. On Expire, Default to Role: Subscriber. Email Notifications: User Expired Notification.

    I have over 400 members so you can imagine that I do not want to manually update all of them indefinitely. Does anyone have a workaround for this?

Viewing 15 replies - 1 through 15 (of 15 total)
  • I was able to change the code on lines 9-15 in includes/expire-user.php to the following to automatically check the boxes for sending an email on expiry and removing expiry details for new users. See below.

    // Settings
    var $expire_timestamp = null;
    var $on_expire_default_to_role = false;
    var $on_expire_user_reset_password = false;
    var $on_expire_user_email = true;
    var $on_expire_user_email_admin = false;
    var $on_expire_user_remove_expiry = true;

    However, if I change the expire_default_to_role option to ‘true’ then the only role available when editing a user is ‘Administrator’. Does anyone have any suggestions?


    I am having the same issues, I am using pie-register form for user registration, but expiration settings are not applied to the new user, the expire date is showing “NEVER”, I am using wordpress 4.4.2.

    My problem is worse than I thought — Expired users are supposed to be downgraded to “Subscribers” when the expiration date is reached and this is NOT happening even when all of the settings are configured correctly.

    Does anyone have another plug-in suggestion to replace this one? I am beyond frustrated.

    @husobj – I could really use your help with this. I need the role to change to ‘subscriber’ when a user expires. That’s it. The code in the current plug-in version to make this happen is not working.

    Hi, I have the same problem – I am registering users via Gravity Forms but need to set their expiry automatically. @tlkativ were you able to resolve this? Many thanks in advance.

    @pennstar — I was able to set the expiration date through the form but the plug-in is still not changing the role automatically after expiration.

    However, here’s what I did to add an expiration date to the database —

    Create a hidden field in your Gravity Form and name it expiration date (or whatever).
    Under the Advanced tab, check “Allow field to be populated dynamically” and put “timestamp” in the text box.
    Then, add the following code to your functions.php file to convert the date into a UNIX value…

    /* Populate Date: Year from Current Date */
    add_filter("gform_field_value_timestamp", "unixtime");
    function unixtime($value){
    return strtotime("+365 days");

    Hope that helps.

    Hi @tlkativ thank you so much for your help, I’ve gone about this a slightly different way but couldn’t have done this without your assistance. I’ve not tried the role switching yet but will let you know how I get on and if it works for me. Once again thanks for taking the time to reply, I really appreciate it! Penny

    Hi @tlkativ I don’t suppose you figured out a way to update the checkboxes ( User Expired Notification, User Expired Admin Notification etc) via Gravity Forms? I’ve tried every which way of updating them but without success. I didn’t really want to hack the plugin to do it! Thanks so much.

    @pennstar Ah yes — Unfortunately I did have to hack the plug-in to make sure the correct items were automatically checked for my needs. Let me know if you want me to share the code I modified.

    @tlkativ @pennstar

    Hey there! Hoping one of you can share some wisdom. I’ve been trying to use this plugin in tandem with Gravity Forms User Registration to set an expiration date 6 weeks out from when a user is created. Already spent too much time trying different tactics, but still no luck. Seems like you both were in similar circumstances recently, thanks for any help!

    An automatic role change would be nice as well but that’s not my priority

    Revisiting your tips, I got everything working except for the role change! Thanks!

    The weird thing now is that my test account says expired in red letters when I view it from the user page, but I can still sign in with my original password and no notification email was sent even though I had those boxes checked.

    Hi @jessica00000 unfortunately I have made the decision to halt development using this plugin and Gravity Forms as there were too many elements that I couldn’t rely on so I can’t assist. A big thanks to @tlkativ for all the help and I hope to revisit this for another project in the future. Good luck @jessica00000!

    Hey all — I did figure out a way to get the role change to work but it involves phpMyAdmin access and replacing a string of code. Annoying but I am going to include it here anyway in case it helps someone else who doesn’t mind editing database entries!

    In the WordPress database table under yourdatabase_usermeta look for the meta_key _expire_user_settings.

    The meta_value for this field will likely read —

    If you change this to —
    it will modify the “On Expire, Default to Role” drop-down to “Subscriber” for that user in your WordPress dashboard.

    I really wish this plug-in just worked as stated.

    @tlkativ Any updates or the simplest workarounds to make this plugin feasible with the Gravity Forms User Registration Add-On?

    I can understand why this plugin doesn’t work with the add-on AS IS as the GF’s add-on isn’t the default WP Registration, nor does it utilize the same hooks. It’s just too bad there isn’t any good alternatives out there from my research.

    Similar to your situation we have yearly memberships that theoretically expire soon, yet we’ve done nothing in terms of development to adjust any data in the database so we’re just trying to find the best solution to have expirations automated for new registrations. With only 15 Users at this point we can get away with manual updates to each user but will have to find an automated solution very soon!

    @rudolph88 I haven’t done any further work on this site in a while so what I have already posted is all the information I have to share on this topic. Sorry!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Expiration settings not applied automatically to new users thru Gravity Forms’ is closed to new replies.