On this page
What this issue is
A hardcoded promotion date is a fixed date written directly into your site's code or content, such as Sale ends 31 March in a template, or new Date('2025-03-31') in a countdown script. Nobody has to update it for it to keep working, which is the problem. When the date passes, the page keeps saying the offer is live.
Why it costs you leads or sales
An expired offer hurts in several ways. Visitors who click an ad promising a sale find a past date and lose trust. Some leave. Others complete the purchase and then ask for the discount you no longer give, which creates support work and refunds.
Example: illustrative numbers only. A landing page converting at 4% with a live offer might drop sharply once the page shows an expired date.
- Ad clickAd promises the sale
- Landing pageShows 'Ends 31 March' after that date
- TrustVisitor doubts the offer
- Checkout or formNever reached
The ad is still running, but the page contradicts it.
How to check if your site has it
Start with the pages your ads and emails link to. Read the banners, hero text, pricing blocks, popups and footers with fresh eyes, then search the code.
- Open each live landing page in a private window and read every date, price and offer line.
- Check the countdown timer: does it show zero, negative values or a past date?
- Look at the page after your last deploy, not only in the CMS preview.
- Search your code repository for month names, years and strings like 'ends', 'until' and 'sale'.
- Search for date literals such as
new Date(with a fixed value. - Check popups, exit-intent overlays, email capture bars and the mobile view.
- Check the page source, because some banners are injected by scripts or plugins.
grep -rniE "(ends|until|valid through|sale ends|offer ends)" ./src ./templates
grep -rnE "new Date\(['\"][0-9]{4}-[0-9]{2}-[0-9]{2}" ./srcHow to fix it
Replace the live text now
Update or remove the expired banner, countdown and offer copy on every page and popup that uses it.
Find every copy of the date
Search templates, scripts, theme settings, email capture tools and page builders. The same date often appears in several places.
Move the date to one source
Store the end date in a single setting, such as a theme option, a CMS field or a config value, and read it everywhere else.
Hide the offer automatically after the date
Make the banner render only while the current time is before the end date, so it disappears by itself instead of showing a past date.
Deploy and re-check the live page
Load the live URL, not the preview, and confirm the old text is gone, including from cached versions.
Search content and widgets
Use Tools or a search plugin to find the old date in posts, pages, widgets, reusable blocks and the Customizer. Check the theme files if it is in a template.
Use a custom field for the date
Store the end date in a field or theme option and compare it to the current time in the template.
Clear caches
Purge your caching plugin and any CDN so visitors stop seeing the old page.
Check theme sections and settings
In Online Store, Themes, Customize, look at the announcement bar and sections. Also search the code editor for the old date.
Use a setting or metafield
Add a text or date setting in the section schema, or a metafield, so the end date is edited in one place.
Review automatic discounts
Make sure the real discount end date in Discounts matches what the page says.
Search the project
Use the Find tool and check symbols, CMS items and custom code in page settings and project settings.
Move the date into a CMS field
Use a CMS collection field for the end date and set the banner to show only for current items where it fits your setup.
Publish
Publish to the live domain, because the staging subdomain may hold a different version.
Check every page and the header
Open the editor and look at the header, footer, banners, popups and mobile view.
Update or remove the text
Edit each place. Wix has no single shared date, so keep a short list of where the offer appears.
Publish
Publish the site and recheck the live URL.
Check announcement bar and blocks
Look at the Announcement Bar, headers, banners, pop-ups and code blocks.
Check code injection
Under Settings, Developer Tools, Code Injection, search for countdown scripts with fixed dates.
Save and recheck
Reload the live page in a private window.
Check funnels and websites
Open each funnel step, including popups and custom code elements, and look for the old date and countdown timers.
Use the timer settings
If you use a countdown element, set its end date or evergreen mode deliberately rather than leaving an old date.
Publish and recheck
Save the step and test the live funnel URL.
Check Custom HTML tags
Banners and countdowns are sometimes injected by a Custom HTML tag. Search your tags for old dates.
Add a time condition
Update the date, or turn off the tag, and publish a new container version.
Centralise the date
Put the end date in one config value or environment variable and import it where needed.
Render conditionally
Show the banner only when the end date is in the future, as in the snippet below.
const PROMO_ENDS_AT = new Date('2025-03-31T23:59:59Z'); // one place to edit
const banner = document.querySelector('#promo-banner');
if (banner) {
if (Date.now() < PROMO_ENDS_AT.getTime()) {
banner.hidden = false;
} else {
banner.remove();
}
}Before
- Date typed into three templates and a popup
- Deploy restores old banner copy
- Countdown shows zero after the end
- Someone must remember to edit it
After
- One setting holds the end date
- Banner hides itself when the date passes
- Deploy reads the same setting everywhere
- A monitor flags old offer text if it appears
How to confirm it's fixed
- Open the live URL in a private window and confirm no past date or old price is visible.
- Check desktop and mobile layouts.
- Check the popup, announcement bar and footer.
- View the page source and search for the old date string.
- Purge page and CDN caches, then reload.
- Confirm the real discount or coupon end date matches the page.
How to prevent it happening again
Treat every promotion as something with a start, an end and an owner. A short routine removes most of the risk.
Before launch
Put the end date in one setting and note every page that uses it.
Launch day
Check the live pages, ads and emails all show the same dates.
Day after the end
Confirm the banner is gone and ads are paused or repointed.
Every deploy
Re-read key landing pages, since a release can bring back old copy.
- Keep promo dates out of code; use a config value or CMS field.
- Add a promotion end task to your release or campaign checklist.
- Pause or update ads on the end date.
- Review old branches before merging so stale banners are not restored.
- Monitor landing pages for stale offer text.
How FunnelGuard handles this
FunnelGuard detects this today with a text absent check. You choose text that should not appear on a page, such as the old date or Sale ends 31 March. A robot visitor loads the page on a schedule, from the EU or the US, and checks that the text is not there.
If the old text shows up, for example after a deploy restores it, the failure is re-checked from a second region first. Then one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. It checks only text you name, so it will not spot every possible outdated offer on its own.
Questions people ask
Why is my sale banner still showing after the sale ended?
The end date is probably typed into a template, script or page builder block that nothing updates automatically. A deploy can also restore older content. Remove the banner, then move the date to one setting that hides the offer when it passes.
Why does my countdown timer show zero or negative numbers?
The timer counts down to a fixed date that has already passed. Update the date, remove the timer, or switch to a rule that hides it once the end time is reached. Also check for copies in popups and injected scripts.
How do I stop expired promotions from showing on my website?
Store the end date in one place, such as a CMS field or config value, and render the offer only while the current time is before it. Add an end task to your campaign checklist and monitor key pages for the old text.
Why did a deploy bring back my old promotion?
A release can ship a branch or template that still contains last season's banner, or overwrite a manual edit made in the CMS. Compare the deployed code with what is live and remove the old copy from the source.
How can I find a hardcoded date in my website code?
Search your repository for month names, years, words like 'ends' or 'until', and fixed new Date( values. Also check theme settings, page builder blocks, popups and tag manager Custom HTML tags.
Can I monitor my site for outdated offer text?
Yes. A text absent check loads the page on a schedule and alerts you if text you named, such as an old end date, appears. FunnelGuard offers this check, and it only looks for the text you give it.
Does an expired date affect Google Ads or SEO?
Ads that promise an offer your page contradicts can lead to poor visits and wasted spend, and ad platforms expect landing pages to match ad claims. Fix the page and update the ad together.
Related issues
- OPS-292Deploy broke landing page or formFix guide
- OPS-293Deploy removed tracking snippetFix guide
- OPS-295Staging config in production (API URLs, test keys)Fix guide
- OPS-304Analytics consent config reset by deployFix guide
- OPS-307Change made without changelog (no root-cause trace)Fix guide
- OPS-308Deploys during peak ad hoursFix guide