How to Automatically Close an Elementor Popup On a Timer (After a Few Seconds)

You are currently viewing How to Automatically Close an Elementor Popup On a Timer (After a Few Seconds)

Creating a sense of urgency and Scarcity in your offers is a powerful marketing tactic, especially when working with WordPress websites that utilize Elementor popups.

If you want to make your limited-time offers more compelling, automatically closing a popup after a set number of seconds can be a game-changer.

In this comprehensive guide, I’ll explain how to set up an Elementor popup that closes after a timer runs out.

This method suits countdown offers, exit-intent popups, and upsell funnels. It gives your visitors a clear call to action and a ticking clock that adds pressure to act quickly.

Why Use an Automatically Closing Popup?

Before diving into the technical steps, it’s’ essential to understand why you might want to use a timed popup that closes automatically:

  • Create Scarcity: When visitors see a popup that lasts only a few seconds, they feel urgency and Scarcity. They know the offer is limited, encouraging faster decision-making.
  • Improve Conversion Rates: Time-limited popups can increase conversions by prompting immediate action rather than letting visitors procrastinate.
  • Control User Experience: Automatically closing popups prevents annoyance and popup fatigue by ensuring the popup doesn’t’ linger forever or require manual closing.
  • Upsell and Funnel Optimization: In sales funnels or cart upsells, limiting the availability of an offer with a popup timer can boost average order values.

Let’s explore how to set this up yourself using Elementor and a simple code snippet.

Step-by-Step Guide to Closing an Elementor Popup Automatically After a Timer.

Create or Edit Your Elementor Popup

Start by opening Elementor and creating a new popup or editing an existing one. I used a simple popup with a timer set to six seconds for this tutorial. You can customize the popup content however you want—this could be a special offer, a lead capture form, or an announcement.

When setting the timer for your popup, you have flexible options.

Depending on your campaign needs, you can set it to count down from seconds, minutes, hours, or even days.

For scarcity-driven offers, shorter timers —such as 30 seconds to 2 minutes —work best, creating a genuine sense of urgency.

Add the HTML Block with Custom Code

Next, drag an HTML widget into your popup layout. This is where you will paste a small snippet of JavaScript code that controls the timer and closes the popup automatically once the time is up.

Elementor HTML widget

Here’s the essential part: you must adjust the timer duration in the code to match the desired duration. The timer is set in milliseconds, so, for example, 6000 milliseconds equals 6 seconds. If you want a 10-second timer, change this number to 10000.

Elementor widget libraries

Here is the exact code snippet for easy copying and pasting. Just replace the number in the code with your desired duration:

<script>
setTimeout(function(){
    document.querySelector('.dialog-lightbox-close-button').click();
}, 6000)
</script>
Close Elementor Popup on timer JS

This script waits for the specified time and then triggers Elementor’s’ popup close function. It’s’ lightweight and practical.

Display and Publish Your Popup

Once you have set the timer and the code in place, ensure that you configure the popup display settings to target the correct pages or user actions. This could occur on page load, exit intent, or another trigger that aligns with your campaign goals.

After setting your display preferences, publish and test the popup to ensure it behaves as expected.

Testing Your Popup in Incognito Mode

One important note is that if you test the popup while logged in to your WordPress admin, the timer may not function correctly because Elementor often turns off specific scripts for logged-in users. To get an accurate test, open your site in an incognito or private browsing window to see how the popup appears and closes after the timer expires.

Prevent the Popup from Reappearing After Closing

By default, refreshing the page causes the popup to reappear, which can defeat the purpose of creating Scarcity. Elementor has an advanced rule called “Show up to X times” to fix this. Set this rule to 1 so the popup only shows once per visitor session.

Elementor Popup Advanced Rules

This ensures that once a visitor closes the popup (or it closes automatically after the timer), it won’t bother them again on page refresh or subsequent visits during the same session. This is crucial for maintaining a positive user experience while creating a sense of urgency.

Turn off the Close Button for Maximum Scarcity

If you want to ensure you can’t bypass your timed offer by manually closing the popup early, you can turn off the close button entirely. This forces them to act within the timer window or wait until the popup closes automatically.

To do this, go to your popup settings and turn off the close button. After saving, your popup will no longer have a manual close option, increasing the pressure to engage with the offer before the timer runs out.

Tips for Using Timed Popups Effectively

  • Keep it Short: Keep the timer under 2 minutes for scarcity offers. Longer timers reduce urgency.
  • Clear Call to Action: Ensure your popup clearly explains the offer and instructs the visitor on the next step before closing.
  • Use Cookies or Session Storage: Consider using cookies or session storage to track whether a visitor has seen the popup so you don’t repeat visitors.
  • Test on Multiple Devices: Ensure the popup behaves well on both mobile and desktop devices, particularly with timers and automatic closing.
  • Combine with Other Triggers: Use exit intent or scroll percentage triggers to show the popup at the best moment.

Conclusion

Automatically closing an Elementor popup after a few seconds is a simple yet powerful way to drive urgency and improve conversions on your WordPress site.

With just a bit of custom code and the proper popup settings, you can create a one-time offer that visitors must act on promptly or risk missing out.

By following the steps above—setting your timer, adding the JavaScript code, limiting popup reappearances, and optionally turning off the close button—you’ll have a professional, scarcity-driven popup ready to enhance your funnels and promotions.

Feel free to leave questions or comments if you need help implementing this tutorial on your site.

Remember, the key to success with timed popups is testing and tailoring the experience to your audience’s behavior and preferences.

Also, make sure to subscribe to our YouTube channel and like our page on Facebook.

PluginsForWP

PluginsForWP is a website specializing in redistributing WordPress plugins and themes with a variety of knowledge about WordPress, internet marketing, and blogging.

Leave a Reply