How to set listing expiration period?

On a previous support entry at that was about subscriptions, you made the suggestion to:

There may be a workaround if you set the listing expiration period, then users would have to re-purchase the package to keep the listings visible by renewing them.

It seems that a listing expiry time can be set for Listing Packages, but that is the time after a listing expires after being published.

That of course is not the same as let’s say monthly paid listings where all the listings of the vendor have to expire, regardless of when they have been published.

I have been looking through the components/class-listing-package.php file (L130-133) where this expiration time is set, would there be a way to alter that in such a way that the plugin can still be updated?


original support request at; received reply with suggestion to post here if familiar with WordPress customizations.

Sorry, we have made the research and unfortunately, there’s no simple code snippet for this. It would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work

Hello, originally I posted on forums and the person replying to me said

Yes, if you’re familiar with WordPress customizations we can provide some general guidance on how to implement this (emphasis mine)

What you’re telling me now is quite the opposite.

Should I just hack the plugin then in a non-sustainable way and change the limit to 30days or something? Hard to believe that you would recommend that way as Hivepress…

Yes, sorry for the confusion, after the research it appears that there’s no easy way to do this. If you mean the functionality similar to “publish X listings during a month” this would require a custom implementation - Paid Listings work in a different way, you just offer listing packages with specific listing limits and users can spend these limits anytime (each listing submission or renewal reduces the limit).

Hi Ihor,
Thanks for looking into this.
With all due respect, from the get-go I have known that this would be a customisation. Given how the rest of Hivepress works and can be customised, I had hoped that (also) the Paid Listings plugin could be adapted with a filter or something.
I understand now from you that there is none and that it is therefore also not possible to sustainably hack this plugin?
So that would mean that I have to replace the get_expire_period() in the components/class-listing-package.php file (L130-133) with something that renews monthly. Any tips on how to go forward with this?

Please describe the required changes in detail, there may be a workaround. Most of the functionality can be altered via hooks, but some workflows can’t be changed and require a custom implementation. If you mean monetizing the website by selling a subscription with “Offer X listings per month” and hiding all listing once the subscription expires this would require developing a custom extension.

Will the new Membership plugin include this function?

Yes, if you mean a new monetization extension (will most likely be released as a Memberships update) we’ll add a recurring billing feature.

1 Like

Bizarre that this has to take 5 days whereas my desired change has been known from the very beginning.

Again then:

Instead of having the paid listings expire x days after publishing, I would like to set it that every listing (or listing package) has a calendar month validity. That way I can charge vendors on a monthly basis regardless of whether they use all listings in their package.

Current situation is that vendor buys package of 10 listings, each with a validity of let’s say 30 days, which basically means that for 10 months the vendor can publish one listing per month.

I want to charge vendors on a monthly basis for their listing package. If they use all listings fine, if not, their loss.

Hope it’s clear now.

Thanks for the details. Yes, unfortunately there’s no simple fix for this, this is a different monetization model - packages are not like membership plans with “listings are visible while the plan is active” logic, they are like bundle deals for publishing listings, e.g. you purchase a package of 10 listings and you can “spend” this limit for adding/renewing listings anytime. We plan to add the subscription option and turn packages into plans, but this will be released as a Memberships extension update.

You have now said the exact same thing 10 different times. First you say difficult followed by maybe difficult and then you start talking about something else.

It’s either possible or it is not. I have asked for pointers on how to go ahead. You guys developed the plugin, so you should know and either you give that information or you don’t.

Using the word “maybe” over and over not only implies that you have some ideas about it, by keeping me on the line for almost a week now, you have now managed to completely and utterly wasting my time.

Can’t rate your support unfortunately, so I can only say here that it is 100% crap and this is not the way to deal with requests.

As noted, the monetization model you described would require developing a separate extension, because Paid Listings has a different logic for restricting listings. We have a tutorial showing how to develop a sample extension, so if you’re familiar with WordPress-specific development you can check it Create a custom HivePress extension - Developer Docs It’s not possible to provide some general guidance about this, this is not a simple code snippet or a fix in the existing functionality.

This answer couldn’t be provided right away because this required some research in the Paid Listings codebase (which our developer @yevhen did, even though both the HivePress core and Paid Listings extension are free and open-source). In any case, I hope you’ll find a better solution for your project.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.