How Do I Set Registration to Expire on Set Date in Membership


Thank you in advance for the great support. On the website we would like to configure the memberships plugin so that they can register between May 1 – May 31 and buy their annual memberships for the 2014-2015 year. On April 30, 2015 we would like that membership to expire, so that they have to take the extra step and register again for the 2015-2016 year. I have the subscription plan set to “finite” but is there a way to make it have a hard cut off date of April 30, 2015? Is there a method you could recommend that is optimal for this type of setup?

Thanks and regards,


  • Timothy
    • Chief Pigeon

    No eta, it could be a while. sorry.

    As a quick way around this you could run a query on the DB directly:

    UPDATE 2013site_46_m_membership_relationships SET expirydate = '2029-05-15 11:54:43'

    You need to edit the TABLEPREFIX to your own, and the date too of course.

    Take care.

  • hazenreed
    • Design Lord, Child of Thor

    Hi Again, Folks, In the scenario AD describes above, do I understand correctly that this would mean there would need to be multiple memberships, one for 2014-2015, then another for 2015-2016, etc. Each would have the same basic access, the only difference being the Expiration Date..which is not officially connected to the membership at all.

    So to make this use-case real, we would need to apply the sql query only to the targeted expiry dates. What is the right step to apply that targeting? It seems the sql above would change every expiry to the April30 date, regardless of whether that is in fact accurate. For example,it would change a membership that expired two years ago, and the end-result would be that those expired memberships would suddenly be active again.

    Furthermore, to make this work for the upcoming year, it appears to me that all “subscribers” for the 2015-2016 membership would have to have already purchased their membership so that they could be in the db. The solution is not tied to the membership per-se, but instead tied to the record of the membership in the user’s records. Am I missing something here?

    Is there really no way to make the membership “products” finite for a specific date range? That seems to me to be the definition of finite. Users should be able to buy a calendar year membership, specifically between the dates May 1, 2014 through April 30, 2015, and then another one May 1, 2015 through April 30, 2016.

  • Vaughan
    • Support/SLS MockingJay

    Hi Hazen,

    You can set the subscription plan to 1 year Finite.

    This means that the subscription will expire exactly 1 year after the subscription start date.

    What you asked in your other thread was;

    Hi Folks, My client wants their memberships to end on March 30, 2015. How can we make this happen?

    Which I interpreted as that you wanted to make all memberships end at that specific date.

    So yes, it is possible to do what you ask, but the year would start from the date they subscribed.

    It’s not possible to have say and end date of 31/03/2015

    Then a member subscribes to the annual plan in say september & then have their expiry date still be march, because they paid for 12 months, so if they registered in september, they would get 12 months, so their expiry date would be then september.

    Hope this helps

  • hazenreed
    • Design Lord, Child of Thor

    Hi Vaughan, Thank you. I realize the inequality of the request.

    This client wants their membership year to be the exact same date for all members. For example 1/1/2014 through 12/31/2014. They do not care that members who join in July will have lost half their time. The cost is the same to the member who buys in January, as it is for the member who buys in July.

    Can this plugin be made to work like this?

  • Vaughan
    • Support/SLS MockingJay


    It would only work if you had a yearly plan and they all signed up on the same date.

    So what you could do is change all their expiry dates.

    UPDATE wp_m_membership_relationships SET expirydate = '2014-12-31 23:59:59'

    If you wish to make it so it only changes the dates for people joining in 2014 you could do;

    UPDATE wp_m_membership_relationships SET expirydate = '2014-12-31 23:59:59' WHERE startdate > '2014-01-00 00:00:00'

    There is no current way to have memberships for specific date ranges, so this is the only way possible at the moment by editing via MySQL.

    Hope this helps

  • hazenreed
    • Design Lord, Child of Thor

    Hi Vaughan, Thank you. it helps in knowing that it is not possible. It does not help for us moving forward. The sql update is not realistic for many reasons. As soon as I do the update, another member joins, it is out of date. This would be very hard to maintain. What it appears is that this plug-in is not right for this application. I really wish I could have known this previously. Maybe we can convince the client to adapt to the plugin, but I think that is unlikely.

    It is a shame, we have invested a lot of time and effort to get this working only to find out now that it is not a usable product for this client. I know there has been discussion about updating this plugin with this feature. Is there any read on if and when it will be made ready?

  • Vaughan
    • Support/SLS MockingJay


    It maybe possible we could hook into membership so this is done automatically when a new member subscribes, we would need some more specifics though.

    So I gather from your request you want the dates may till april 30 (The UK tax year?)

    So any members signing up from may 1st 2014 till april 30th 2015 would have their expiry set as April 30th 2015

    (not sure that users registering in march/april 2015 would appreciate that, so i assume you would move them to the next tax year? not sure how you would proceed with that.)

    so then when next year comes, any members signing on or after may 1st would have their expiry dates set as 30th april 2016?

    If I understand you correctly?

  • hazenreed
    • Design Lord, Child of Thor

    Hi Vaughan, I am excited to hear you say this. Let me try to map this out.

    If we could create a membership product for each year-term, we would be OK.

    We’re in 2014, but the year term is actually April 1, 2014 through March 31, 2015. Let’s call the 2014 – 2015 Membership.

    Then we’d need another membership, the 2015- 2016 Membership, April1, 2015 through March 31, 2016.

    If it were me designing the code, I would add one Mode option to have a Start Date, and End Date. By allowing these two options, we could easily create the options we’d need. and Even offer a half-year option. Granted, this adds labor onto the site owner to keep setting up these “products,” one for each term, but it would achieve the goal.

  • Vaughan
    • Support/SLS MockingJay

    Hi Hazen,

    I think i’m just about getting there, just a few more tweaks to make.

    But i’m basing it on certain conditions, the only way I can think of to get it working as you require is if you set each subscription plan up as follows:

    Finite – 1 Year

    Subscription Name: YEAR

    Basicly, each subscription plan name must begin with the YEAR.

    So for 2014 – 2015 the subscription plan name must start with 2014

    for 2015 – 2016 the subscription plan name must start with 2015

    and so on.

    I have the expiry date then set at 31-03-YYYY 23:59:59

    If this is ok?


  • Vaughan
    • Support/SLS MockingJay


    No, they are in the code, I am simply creating a mu-plugin which is a custom function that will change the expiry dates on the fly depending on the subscription plan, so if you need to change the dates, you would need to edit the file itself. It just hooks into the membership plugin gateway function and changes it once the gateway receives a response back that the user has paid.

    I’ll make changing the date as easy as possible from within the file.

    Hope this helps

  • hazenreed
    • Design Lord, Child of Thor

    Hi Vaughan, I am sure this will become clear in the end, but right now, I do not understand.

    Are you saying that there will be a block of code for each membership year, actually hard coded somewhere?

    I guess that could work, but it seems a bit awkward.

  • Vaughan
    • Support/SLS MockingJay

    Hi Hazen,

    Not quite, I have tried to make it as simple and as automatic as possible, the only conditions are as stated above.

    The subscription plan must start with the YEAR ie. 2014 or 2015 etc.

    In the code, there is 1 line, that you can change.

    $expire_time = '03-31 23:59:59'; // MM-DD HH:MM:SS

    So basicly this will change the expire date/time for new subscribers.

    as above example.

    The above will make each plans expiry date = 31st March at 23:59:59.

    The year is then taken from the plan & added automatically.

    So for those subscribing to the plan for 2014 the year will be added automatically so the actual expiration date will be 2015-03-31 23:59:59

    So all you need to do if you wish to change the expiry date is change that line.

    So changing it to:

    $expire_time = '05-20 23:59:59'; // MM-DD HH:MM:SS

    Will make it expire on 20th May in the following year. So really this is quite simple for you to do & probably doesn’t need changing once you set it.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.