The sale date you set in WooCommerce has arrived and the product still shows its regular price, or the sale ended yesterday and shoppers still pay the sale price. This page is for the store owner or developer who has to explain that, and fix it, today. WooCommerce switches the price with a background job at the start and at the end of the sale, and that job waits until the store’s task queue runs. In most cases the queue was late or stopped, the dates fall at a different hour than you expected, or a cache is still serving the old price. A few commands tell you which one it is, and one command forces the switch.
What you’ll accomplish
- Read the exact second the sale starts and ends, as WooCommerce stored it.
- Tell apart the three causes: wrong dates, a job that did not run, or a cache serving old pages.
- Force the overdue price switch now, without editing each product by hand.
- Make the queue run on time, so the next sale starts and ends without you.
Prerequisites
- Any WooCommerce version from 3.0. The mechanism changed in 10.1, 10.5, 10.8 and 11.1, and the steps say where it matters.
- An administrator account, and shell access with WP-CLI (the
wpcommand). Run the commands from the site’s root directory as the user that owns the files. - The product’s ID. In Products, hover the product name; the ID appears in the row of links under it. The examples use a simple product,
412, and a variable product,388.
How it works
A product has three price fields in the database. _regular_price and _sale_price hold what you typed. _price holds the active price, the one shown on shop pages and charged in the cart. A scheduled sale works by rewriting _price at the right time.
The dates are whole days in the site’s timezone. In the classic product editor, the Schedule link next to Sale price opens two date fields. WooCommerce stores the first as 00:00:00 of that day and the second as 23:59:59 of that day. Both use the timezone from Settings → General, and both are saved as Unix timestamps, a count of seconds in UTC. The end date is included in the sale.
What rewrites _price depends on your version:
| WooCommerce version | What switches the price | Usual delay |
|---|---|---|
| Before 10.1 | One WP-Cron event, woocommerce_scheduled_sales, once a day, set for midnight site time | Until the first visit after midnight |
| 10.1 to 10.4 | The same daily job, moved into Action Scheduler | Until the queue runs the daily job |
| 10.5 and newer | A start job and an end job per product at the exact stored time, plus the daily job as a catch-up | One queue run, normally about a minute |
| 10.8 and newer | The same, and the jobs are also created for variations and when a plugin or importer writes the dates straight to the database | One queue run |
| 11.1 and newer | The same, and simple products also show and charge the right price when a page is built, before the job runs | None for the product page and cart |
Action Scheduler is the background job queue bundled with WooCommerce. It is started every minute by WP-Cron, the WordPress task runner, and WP-Cron only wakes up when someone loads a page. Pages viewed in wp-admin also start the queue. So every row of the table depends on the same thing. On a quiet store at midnight, or on a site where WP-Cron was switched off and nothing replaced it, the job waits.
From 10.1 the daily job starts out at midnight site time. Action Scheduler then books each run 24 hours after the previous one ran, so the time slides later with every delay.
Variable products add one more rule. Each variation has its own dates and, from 10.8, its own jobs; the parent has none. A variation recalculates its own price from its dates each time it is loaded, so the cart charges the right amount. The “From” price range on the parent is cached, and stays old until a job runs for one of its variations or the product is saved.
Step-by-step
-
Check your WooCommerce version. It decides which rows of the table apply:
wp plugin get woocommerce --field=versionExample output:
11.3.0 -
Read what is stored for the product. This prints the three prices and the two dates:
wp post meta list 412 --keys=_regular_price,_sale_price,_price,_sale_price_dates_from,_sale_price_dates_toExample output:
+---------+------------------------+------------+ | post_id | meta_key | meta_value | +---------+------------------------+------------+ | 412 | _regular_price | 64 | | 412 | _sale_price | 48 | | 412 | _price | 64 | | 412 | _sale_price_dates_from | 1795755600 | | 412 | _sale_price_dates_to | 1796101199 | +---------+------------------------+------------+Compare
_pricewith the other two. During the sale it must equal_sale_price; outside it,_regular_price. Here the sale should be on and_priceis still 64, so the switch has not happened. An empty_sale_pricemeans there is no sale to start. WooCommerce clears that field when the sale price is not lower than the regular price. Before 10.5, the daily job also empties the start date once the sale has started, and removes the sale price and both dates when the sale ends. -
Turn the two timestamps into dates. Read the site’s timezone first, then convert:
wp option get timezone_string wp option get gmt_offset TZ=America/Toronto date -d @1795755600 TZ=America/Toronto date -d @1796101199 dateExample output:
America/Toronto -5 Fri Nov 27 00:00:00 EST 2026 Mon Nov 30 23:59:59 EST 2026 Fri Nov 27 08:20:14 EST 2026Put the value of
timezone_stringafterTZ=. If that line is empty, the site uses a fixed offset, shown bygmt_offset; set a named city in Settings → General so daylight time is handled. If the two dates are not the ones you meant, or the timezone is wrong, the dates are the cause. Fix the timezone, open the product, re-enter the dates and click Update. If the dates are right and the current time is past one of them, a job is late: continue. -
Look for the jobs. This lists the product’s start and end jobs and the daily catch-up job:
wp db query "SELECT action_id, hook, status, scheduled_date_gmt, args FROM $(wp db prefix)actionscheduler_actions WHERE (hook LIKE 'wc_product_%_scheduled_sale' AND args LIKE '%:412}') OR hook = 'woocommerce_scheduled_sales' ORDER BY scheduled_date_gmt DESC LIMIT 6"Example output:
+-----------+---------------------------------+----------+---------------------+--------------------+ | action_id | hook | status | scheduled_date_gmt | args | +-----------+---------------------------------+----------+---------------------+--------------------+ | 5812 | wc_product_end_scheduled_sale | pending | 2026-12-01 04:59:59 | {"product_id":412} | | 5790 | woocommerce_scheduled_sales | pending | 2026-11-27 05:02:44 | [] | | 5811 | wc_product_start_scheduled_sale | pending | 2026-11-27 05:00:00 | {"product_id":412} | | 5764 | woocommerce_scheduled_sales | complete | 2026-11-26 05:02:09 | [] | | 5671 | woocommerce_scheduled_sales | complete | 2026-11-25 05:01:37 | [] | | 5598 | woocommerce_scheduled_sales | complete | 2026-11-24 05:01:12 | [] | +-----------+---------------------------------+----------+---------------------+--------------------+The times are in UTC; run
date -uto compare. Read the result this way:- A
pendingrow whose time has passed means the queue is late or stopped. Here the start job was due at 05:00 UTC, the daily job at 05:02, and it is now 13:20. Go to step 5. - No
wc_product_rows at all is normal before 10.5. On 10.5 to 10.7 it is also normal for variations, and for products whose dates an importer or sync tool wrote directly. On any version, a date already in the past when the product was saved gets no job. The daily job covers all these cases, so go to step 6. - No
woocommerce_scheduled_salesrow on 10.1 or newer means the daily job is missing. Step 6 does its work by hand. On current versions WooCommerce registers the job again by itself, within about a day. Before 10.1, look for it withwp cron event listinstead. - Both jobs
completeand_pricecorrect means the database is right and a cache is not. Go to step 7.
- A
-
Check that the queue is being started. Look at the WP-Cron event that runs Action Scheduler, then test WP-Cron itself:
wp cron event list --hook=action_scheduler_run_queue --fields=hook,next_run_gmt,recurrence wp config get DISABLE_WP_CRON wp cron testExample output:
+----------------------------+---------------------+------------+ | hook | next_run_gmt | recurrence | +----------------------------+---------------------+------------+ | action_scheduler_run_queue | 2026-11-27 04:12:37 | 1 minute | +----------------------------+---------------------+------------+ true Error: The DISABLE_WP_CRON constant is set to true. WP-Cron spawning is disabled.A
next_run_gmtmore than a few minutes in the past means nothing has started WP-Cron since then. If the second command printstrue,DISABLE_WP_CRONis on and the site expects a server cron job to do it. Check withcrontab -lthat an entry callswp-cron.phporwp cron event run --due-nowevery minute; if none does, add one by following replacing WP-Cron with a system cron job. Ifwp config getanswers that the constant is not defined, WP-Cron relies on visits, and a store with no traffic at midnight switches prices late. The same article fixes that case. Whenwp cron testreports an HTTP error, the server cannot call itself; the article covers that too. -
Force the overdue switch now.
wc_scheduled_sales()is the function behind the daily job. It finds every product whose start or end time has passed and whose_priceis still wrong, and corrects it. It exists on every version from 3.0:wp eval 'wc_scheduled_sales();' wp post meta get 412 _priceExample output (the first command prints nothing):
48_pricenow equals_sale_price, or_regular_priceif you were ending a sale. If it did not change, go back to step 2: either the sale price is empty or the dates do not say what you expect. On 10.5 and newer, also clear the late jobs so the list is clean:wp action-scheduler run --hooks=wc_product_start_scheduled_sale,wc_product_end_scheduled_sale --group=woocommerce-salesExample output (progress bar omitted):
Found 1 scheduled task Started processing action 5811 Completed processing action 5811 with hook: wc_product_start_scheduled_sale 1 batch executed. Success: 1 scheduled task completed.Only jobs whose time has passed are run. The end job stays
pendinguntil the end of November 30. -
Purge the page cache. When the job runs, WooCommerce clears its own cached data, such as the list of on-sale products and the price ranges of variable products. It cannot empty a full-page cache or a CDN (content delivery network), which keep serving the HTML they stored before the switch. Purge the product page, the shop and category pages and the home page in your cache plugin or CDN dashboard. Then count the lines that contain the sale price in the HTML a visitor without cookies receives. Write the amount the way your store displays it:
curl -s https://shop.example.com/product/merino-scarf/ | grep -c '48\.00'Example output during the sale:
2Any number above
0means the page carries the sale price.0during the sale means the cache still holds the old page, so purge again or check the CDN. After the sale has ended,0is the result you want. -
For a variable product, check each variation. The parent has no dates of its own. List the dates of every variation:
for id in $(wp post list --post_type=product_variation --post_parent=388 --format=ids); do echo "$id $(wp post meta get $id _sale_price_dates_from) $(wp post meta get $id _sale_price_dates_to)"; doneExample output:
389 1795755600 1796101199 390 1795755600 1796101199 391Variation
391has no dates, so it was left out of the sale. In the product editor, open the Variations tab, choose the bulk action Set scheduled sale dates to set all variations at once, then save.
Validate it works
Run the three checks again after the fix:
wp post meta list 412 --keys=_regular_price,_sale_price,_price
wp db query "SELECT COUNT(*) AS overdue FROM $(wp db prefix)actionscheduler_actions WHERE status = 'pending' AND scheduled_date_gmt < UTC_TIMESTAMP() - INTERVAL 5 MINUTE"
wp cron event list --hook=action_scheduler_run_queue --fields=hook,next_run_gmt,recurrence
You are done when _price matches the price that should be active and overdue is 0. next_run_gmt should be within a minute or two of date -u. Then load the product page in a private browser window and add the product to the cart. The page, the shop listing and the cart should show the same price. The real proof comes at the next boundary: after the end date, run step 2 again and _price should be back to _regular_price without your help.
Troubleshooting
- The sale ran one day longer than you wanted. The second date is the last day of the sale, through 23:59:59. To have regular prices back on December 1, set the end date to November 30.
- The sale started or ended a few hours off. The timezone in Settings → General was wrong, or was changed after the dates were saved. Stored timestamps do not move when the timezone changes. Correct the timezone, then re-enter the dates and update the product.
- The cart is right but the shop page is wrong. On 11.1 and newer, a simple product’s price is corrected each time a page is built, even before the job runs. Nothing tells a page cache to refresh at that moment, though. Sorting, price filters and on-sale lists also wait for the job. Get the queue running (step 5), then purge.
- The “From” price on a variable product is still old. That range is cached in a transient, a value WordPress stores with an expiry date. Run step 6, then
wp transient delete wc_var_prices_388with the parent’s ID.Success: Transient deleted.confirms it. - On-sale blocks or sorting by price still show the old state. They read the product lookup table. Since 10.8 the sale jobs refresh it. On older versions, go to WooCommerce → Status → Tools, find Product lookup tables and click Regenerate.
- A pricing, membership or multi-currency plugin is active. When another plugin has already changed the price, the 11.1 correction leaves that price alone. The price then switches only when the job runs, so the queue matters even more.
When this is the wrong approach
The Schedule dates suit sales that run for whole days. The classic editor cannot start a sale at 9 a.m., and behind a full-page cache the visible switch also depends on a purge. For a launch that must happen at an exact minute, have a server cron job change the price with wp wc product update, which needs the --user flag with an administrator account. Purge the cache in the same script. If the queue is late for everything, not only for sales, start with auditing the Action Scheduler queue. Order emails and webhooks are waiting in that same queue. The WooCommerce guide to managing products describes the price fields, and the Action Scheduler WP-CLI page lists every option of the run command.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.