Skip to main content

Add a Sale Countdown to an Elementor Page with Premium Addons and AI

A countdown to your deadline with a heading and a button, previewed on a draft copy before it goes on the live page.

Difficulty Beginner
Time ~10 min

Prerequisites

A site connected to WPVibe running Elementor (free is enough) and Premium Addons for Elementor 4.11.111 or newer (tested on 4.11.111, the free version) on WordPress 7.0 or newer, with an administrator account and Premium Addons' AI tools on: in wp-admin, Premium Addons > MCP Config & AI Abilities, switch on Enable MCP & AI Abilities. A page built with Elementor.

The prompt
My WordPress site uses Elementor and the free Premium Addons for Elementor plugin. Add a sale countdown to my page [page title]: heading "[heading, for example Spring Sale: 30% off every plan]", a countdown to [date and time, for example October 31 at 11:59 pm], a button "[button text]" linking to [URL], and when the time is up the countdown shows "[message, for example The sale has ended.]". Put it [before the section that starts with X, or at the end of the page].

1. Run get_ability_info for each Premium Addons ability this recipe uses: premium-addons/get-page-structure, premium-addons/check-elementor-element, premium-addons/get-widget-schema and premium-addons/duplicate-post. If none is found, stop and tell me to turn Premium Addons' AI tools on in wp-admin: open Premium Addons, then MCP Config & AI Abilities, and switch on Enable MCP & AI Abilities. If only some are missing, stop and tell me to switch those back on under Manage AI Abilities on the same screen. Premium Addons keeps its build tools (insert-widget, add-container and the rest of its build group) and its template library off the REST API, so WPVibe can't call them; don't look for them, and ignore its design guide where it names them. Load WPVibe's elementor skill for the element format.
2. Find the page with GET /wp/v2/pages?search=[page title]&status=publish,draft,private, then read it with rest_api GET /wp/v2/pages/PAGE_ID with query context edit and _fields id,modified,link,meta._elementor_edit_mode. PAGE_ID is its id and PAGE_URL its link; SITE_URL is my site's address. If _elementor_edit_mode is not builder, stop and tell me the page isn't built with Elementor. Read its layout with premium-addons/get-page-structure and note the ids of its top-level sections, in order.
3. Check my site's timezone with GET /wp/v2/settings (timezone). The countdown counts to a time in that timezone. If I gave my deadline in another timezone, convert it to the site's and tell me both; never change the site's timezone setting. If the site's timezone is empty or UTC, ask me which timezone I meant before you go on.
4. Before you write any Premium Addons widget, run premium-addons/check-elementor-element with its type (if available is false, stop and tell me: it is Pro or switched off), then premium-addons/get-widget-schema with tab content, and use only the keys it lists. Any key you leave out falls back to the schema's default, and some defaults are demo text (the countdown's default date and Countdown Expired!), so set every text you need. Give each new element a new id of 8 random lowercase hex characters, and each repeater row its own _id of 7. NEW_ID is the id of the new section's outer container. The new section is one container (flex_direction column, flex_align_items center) holding a premium-addon-title (premium_title_text, premium_title_tag h2), a premium-countdown-timer (premium_countdown_type fixed, premium_countdown_date_time as YYYY/MM/DD HH:MM in the site's timezone, timezone wp-time, expiration_type text, expiration_text my message) and a premium-addon-button (premium_button_text, premium_button_link_selection url, premium_button_link with my URL).
5. Never resend or retype the page's whole layout: add the section with one small edit. Write it as one compact JSON object, then call rest_api_write POST /wpvibe/v1/content/edit with target_type meta, meta_key _elementor_data and the post_id named below. Before a top-level section: old_content is {"id":"NEXT_ID" (that section's id with the brace and quotes in front), new_content is the new section, a comma, then that same old_content. At the end of the page: run POST /wpvibe/v1/content/search on the same meta with pattern set to the last top-level section's id; its match runs to the end of the value. Take its last 60 to 120 characters, ending with the final closing square bracket, as old_content, and as new_content the same text with a comma and the new section added just before that final bracket. content/edit changes text only where old_content matches exactly once, and refuses an edit that would break the JSON; if it refuses, take a longer old_content and try again. Never use replace_all. Keep the old_content and new_content you used: swapping them is the undo.
6. Copy the page with premium-addons/duplicate-post. COPY_ID is the post_id it returns; the copy is a draft. Add the section to the copy (post_id COPY_ID) as above. Give me the copy's preview link, SITE_URL/?page_id=COPY_ID&preview=true (it only opens while I'm logged in), describe the section, and wait for my yes. Nothing on my live page has changed yet. If I say no, move the copy to the trash with rest_api_write DELETE /wp/v2/pages/COPY_ID and stop.
7. On my yes, read the page's modified date again; if it changed since step 2, stop and tell me someone edited it. Otherwise make the same edit on the live page (post_id PAGE_ID). Run premium-addons/get-page-structure on it and check every top-level section id from step 2 is still there, in the same order, with NEW_ID where I wanted it. If not, undo the edit and tell me what you saw.
8. Fetch the live page with get_page_html, selector .elementor-element-NEW_ID, and check my heading is in it. That fetch skips page caches, so then run run_wp_cli cache purge --url=PAGE_URL so visitors get the new version too, and tell me what it reported; if it found no cache plugin and my host caches pages, I purge it there. In that section's HTML, check the countdown's data-settings until value is my deadline.
9. Tell me, whatever the purge reported: Premium Addons' countdown counts from the time the page was built, so a cached copy of the page runs late by as long as it has been cached; leave this page out of any page cache until the sale ends. Ask me to open the live page and watch the timer tick. If my site keeps uploads in cloud storage (an offload plugin) and the timer doesn't appear or shows my message straight away, tell me: Premium Addons' Dynamic Assets Generate links its per-page script from my uploads address, and turning it off (Premium Addons, then Widgets & Add-ons) fixed that on WPVibe's test site.
10. Move the draft copy to the trash with rest_api_write DELETE /wp/v2/pages/COPY_ID. Tell me how to undo: content/edit on the page with the old_content and new_content you used, swapped. Give me the page link and its Elementor edit link.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Add a Sale Countdown to an Elementor Page with Premium Addons and AI” recipe from the WPVibe cookbook on my connected site.

A sale that ends Friday sells better when the page says so. Free Elementor has no countdown widget, and the free Premium Addons plugin does, but setting the deadline in the right timezone, the message when it runs out and the button under it still takes a trip through the editor.

The AI builds a section with a heading, Premium Addons’ Countdown and a button on a draft copy of your page, gives you the preview link, and changes the live page only on your yes. It reads your site’s timezone first and sets the deadline in it, then checks the live page for the new section and the ones that were already there.

Turn on Premium Addons’ AI tools first (Premium Addons > MCP Config & AI Abilities). The timer takes the time from the moment the page was built, so a page cache that keeps a copy for hours makes it run late by that much; the AI checks for one and tells you to leave this page out of it until the sale ends. The AI adds the section with one small edit and keeps a note of it, so taking it out again is one step.

Outcome

Your page has a countdown to your deadline with a heading and a button, and shows your message once the time is up.