How to Implement Dynamic Closing for WordPress Auction Plugins to Avoid Bid Sniping?

    Praveen Chauhan
Listen to this article
Auto-extend Auction Closing Time

Online auctions are very competitive. Some bidders, choose unethical means to win auctions. For example, some people bid at the last possible minute or even second to win an auction. This activity could disappoint fellow bidders, because they do not have the time to outbid. As an auction website owner this could be very disappointing.

Let me explain.

Suppose a bidder keeps on bidding on an auction. There could be another bidder who just keeps an eye on the same auction, but does not bid. He then places a bid at the last minute, when the auction is just about to expire.  Now, that bidder becomes the winner without having put in much effort, and the effort all other bidders had put in while bidding, has gone waste. This act is known as auction sniping. But then, as an auctioneer, how do you avoid this from happening?


Introducing Dynamic Closing

Not to worry. To prevent such sniping there is a solution. Instead of closing the auction as decided, you could extend the closing time for the auction, keeping the auction live longer than expected. This is known as ‘Dynamic Closing’.

Dynamic closing can also help you extend the time of an auction, without having to re-list it. This could be beneficial, when bidders have not bid much on an auction, even though the auction is about to expire, and last minute bidding could cause the auction to close, without you recovering the expected amount.


How to Add Dynamic Closing?

The logic behind this is very simple. Let’s consider you want to do this for a WordPress based auction plugin, like Ultimate Auction for example. To allow auctioneers to automatically extend the auction time, you will need a few settings, in the dashboard. The auction page in the front-end, should also reflect the added changes, if any.

Admin Settings to Extend Auction Time

Basically, as the auction controller, you will need to specify the below values (which will be added as settings in the WordPress dashboard):

  1. When should the auction time be extended? For example, you might want an auction to be extended if a person places a bid, when less than 2 minutes are left for the auction to expire.
  2. The amount by which you want to extend the time. For example, in the above scenario, you might want to extend the auction time by 30 minutes.
Auto-Extend Auction Settings

Display the Settings Per Item Basis

But, you might not want the time to be extended for all products on auction. In this case you will need to decide where you want to show these additional settings.

  • If you want to keep the functionality on a per auction basis, you will need to display these settings on each auction page (the setting values then, have to be saved as part of the auction post meta i.e., in the ‘wp_postmeta’ table).
  • Or, if you want to keep the functionality common to all the items on auction, you need to add these settings on a common settings page (the values are then saved in WordPress Settings Option, i.e., ‘wp_options’ table)

In fact, if you can also have a combination of the two. For example, the values you explicitly set for individual items on auction, will be used, for the item. Else the common settings will be used as default values for all items on auction if a specific value is not specified.

Limit Number of Times Auction can be Extended

If you want the auction time to be extended only once for each auction, you can add a condition for the same. For example, you can add a meta key, say ‘extended’ and set the value to ‘true’ (for a particular auction item), once the time has been extended. Then, before extending the time, you only need to check if the key exists. If it exists and the value is ‘true’ then it implies, that the time was extended, and you need not extend it anymore. Else, extend the time, and add the key and with the value ‘true’.

Check and Extend Auction Time If Applicable

To check if auction time needs to be extended, you will need to check if the values have been set by the admin, for the particular item. Every time someone accesses a single auction page (in the front end) and places a bid, you need to just run a check to see the current time and compare it with the ending time of the auction.

If the difference is less than or equal to the ‘when-to-extend-auction-time’ (settings option a) value set in the back end, you need to just run a functionality to update the ending time of the auction by adding the time set for ‘amount-of-time-to-extend’ (settings option b).  And that’s it! The time will get extended, and thus will be reflected in the front-end.


The dynamic closing or auto-extend auction time functionality, is great to prevent auction sniping. As you can see it is simple to implement, and thus can be added to any auction plugin like Ultimate Auction or any auction theme. Extending the auction time, can also help you fetch a higher bid amount from your bidders. So, what are you waiting for? Just go ahead and make the needed changes. If you still have any doubts or suggestions, you can leave your comments, in the comment section below. 🙂

Praveen Chauhan

Praveen Chauhan

Leave a Reply

Your email address will not be published. Required fields are marked *

Get The Latest Updates

Subscribe to our Newsletter

A key to unlock the world of open-source. We promise not to spam your inbox.

Suggested Reads

Join our 55,000+ Subscribers

    The Wisdm Digest delivers all the latest news, and resources from the world of open-source businesses to your inbox.

    Suggested Reads