Skip to content

WooCommerce Checkout block vs shortcode: decide, test, and roll back

The Checkout block is a Store API front end that never runs woocommerce_checkout_fields or your classic checkout hooks. Inventory what the shortcode page depends on, test the block on staging against a gateway sandbox, then decide with a rule instead of a hunch.

Do not switch until you can name every hook, filter and plugin your [woocommerce_checkout] page depends on today. The Checkout block is not a re-skin of the classic form; it is a React front end that talks to the Store API and never executes the PHP hooks the classic template fires. That buys you a faster-feeling checkout and the express payment slots, and it costs you any custom field, validation rule or gateway that only exists as classic-checkout PHP. The decision rule is short: if a single required gateway or a single required field has no block equivalent, stay on the shortcode until that plugin ships block support. Everything below is how to prove which side of that line your store is on.

What you’ll accomplish

  • Produce a written inventory of the callbacks, custom fields and gateways your classic checkout actually depends on, rather than guessing from the plugin list.
  • Prove from the command line that the Store API namespace is reachable from the public internet, which is the single most common cause of a blank Checkout block.
  • Stand up the block on a staging copy and put a real sandbox order through it, including shipping, coupons and a gateway redirect.
  • Apply a written rule to the go or no-go decision, and record which plugin is blocking you if the answer is no.
  • Keep a one-command rollback that restores the classic checkout page content byte for byte.

Prerequisites

WooCommerce 9.x or 10.x on WordPress 6.5 or newer, PHP 8.1 or later, and a staging copy that is a real clone of production rather than a fresh install with the same theme. Shell access with WP-CLI available as wp, run as the site user from the WordPress root. Sandbox or test credentials for every payment gateway you actually take money through, because a gateway that renders is not the same as a gateway that completes.

Two assumptions worth stating. The block-based Checkout has been the default page content on stores created since WooCommerce 8.3, so a store still running [woocommerce_checkout] is almost always an older store carrying years of accumulated customisation, which is exactly the store most likely to break. And High-Performance Order Storage changes how order meta is read and written, so if you have HPOS work outstanding, finish the HPOS migration before you also change the checkout rendering path. Two moving parts at once makes the post-mortem impossible.

How it works

The classic checkout is a server-rendered HTML form. WordPress runs checkout/form-checkout.php, and along the way WooCommerce fires a long chain of action hooks that plugins and theme snippets attach to, plus the woocommerce_checkout_fields filter that lets anything reshape, reorder, add or remove a field. The shopper submits, the whole form posts back to ?wc-ajax=checkout, and PHP validates it through woocommerce_checkout_process and woocommerce_after_checkout_validation before saving with woocommerce_checkout_update_order_meta.

The Checkout block does none of that. It renders as JavaScript, reads the cart with GET /wp-json/wc/store/v1/cart, and submits with POST /wp-json/wc/store/v1/checkout. The Store API is a normal WordPress REST namespace, so everything true of /wp-json/ is true of it: if a security plugin, a firewall rule, or a CDN path rule refuses that namespace, the block gets an error instead of a cart and renders as an empty area with no PHP error anywhere in the logs.

Side-by-side comparison of the classic WooCommerce checkout form POST path and the Checkout block Store API request path, with the hooks each one runs

The block does have server-side extension points, but they are different names on a different namespace: woocommerce_store_api_checkout_update_order_from_request and woocommerce_store_api_checkout_order_processed for order-time work, woocommerce_register_additional_checkout_field() for declaring extra fields, and the woocommerce_blocks_payment_method_type_registration action for gateways that want to appear at all. Express methods register separately through registerExpressPaymentMethod in JavaScript, which is why the express area can stay empty even when the same gateway shows up fine as a normal radio button.

Worth knowing for calibration: filters that operate on the cart rather than the form still run in both paths. woocommerce_package_rates and woocommerce_cart_calculate_fees are cart-level, so many conditional shipping and fee plugins keep working. What breaks is the part of those plugins that reads a classic checkout field out of the posted form, or that renders its own UI from a classic action hook.

Step-by-step

1. Record exactly what the checkout page contains today. Everything else depends on knowing your starting state, and this is also your rollback artifact.

wp post get "$(wp option get woocommerce_checkout_page_id)" --field=post_content | tee checkout-page-content.bak
[woocommerce_checkout]

If the output is <!-- wp:woocommerce/classic-shortcode {"shortcode":"checkout"} /--> you are on a block theme rendering the classic form through a wrapper block. Same decision, same rollback file.

2. List every callback attached to the field filter. This is the inventory that decides the outcome. Any callback here is code that the block will not run.

wp eval 'foreach ( ( $GLOBALS["wp_filter"]["woocommerce_checkout_fields"] ?? new stdClass )->callbacks ?? [] as $prio => $cbs ) { foreach ( $cbs as $cb ) { $f = $cb["function"]; $n = is_array( $f ) ? ( is_object( $f[0] ) ? get_class( $f[0] ) : $f[0] ) . "::" . $f[1] : ( is_string( $f ) ? $f : "Closure" ); printf( "%4d  %s\n", $prio, $n ); } }'
  10  WC_Checkout_Field_Editor::filter_fields
  10  My_Theme_Checkout::add_po_number
  20  Closure

A Closure almost always means a snippet in functions.php or a code-snippets plugin. Track it down now, because it will not announce itself later.

3. Count callbacks on the classic action hooks. Same idea, wider net.

wp eval 'foreach ( ["woocommerce_checkout_process","woocommerce_after_checkout_validation","woocommerce_checkout_update_order_meta","woocommerce_after_order_notes","woocommerce_review_order_before_submit"] as $h ) { $c = isset( $GLOBALS["wp_filter"][$h] ) ? array_sum( array_map( "count", $GLOBALS["wp_filter"][$h]->callbacks ) ) : 0; printf( "%-42s %d\n", $h, $c ); }'
woocommerce_checkout_process               2
woocommerce_after_checkout_validation      1
woocommerce_checkout_update_order_meta     3
woocommerce_after_order_notes              1
woocommerce_review_order_before_submit     0

Anything above zero is behaviour that disappears on the block unless the plugin has separately registered a Store API equivalent. Zero across the board is the green light most stores never get.

4. Write down the gateways you actually take money through.

wp eval 'foreach ( WC()->payment_gateways()->get_available_payment_gateways() as $id => $gw ) { printf( "%-22s %s\n", $id, $gw->get_title() ); }'
stripe                 Credit card
ppcp-gateway           PayPal
cod                    Cash on delivery

Keep this list. In step 7 you compare it against what the block renders; a gateway present here and absent there is a gateway with no block integration, and that path is covered in more depth in payment methods not showing at checkout.

5. Prove the Store API namespace is reachable. Do this against the public hostname, from outside the server, not from inside over localhost, because the thing you are testing is the edge.

curl -s https://staging.example.com/wp-json/ | grep -o '"wc/store/v1"' | head -1
"wc/store/v1"

Then fetch a cart and confirm you get JSON with a 200, not a challenge page:

curl -s -o /dev/null -w 'status=%{http_code} type=%{content_type}\n' https://staging.example.com/wp-json/wc/store/v1/cart
status=200 type=application/json; charset=UTF-8

A 403, a 401, or a text/html content type means something in front of WordPress is refusing the namespace. Fix that before you judge the block, or you will misdiagnose a firewall rule as a broken feature.

6. Switch the staging checkout page to the block. One command, and the backup from step 1 is already on disk.

wp post update "$(wp option get woocommerce_checkout_page_id)" --post_content='<!-- wp:woocommerce/checkout /-->'
Success: Updated post 7.

Purge any page cache and CDN cache for the checkout URL afterwards. A cached classic page served over a block page produces symptoms that look like a block bug and are not.

7. Compare the two checkouts field by field and gateway by gateway. Open the staging block checkout in a private window with a real product in the cart, and walk your step 2 and step 4 lists against what you see. Note every field that is missing, every gateway that is absent, and whether the express payment area at the top is populated or empty.

Decision panel contrasting the conditions that favour keeping the WooCommerce shortcode checkout against those that favour moving to the Checkout block

8. Apply the rule, not the mood. One required gateway missing, or one required field missing with no additional-fields replacement available, means the answer is no for now. Record which plugin it was and check its changelog again next quarter. A clean sheet means you schedule the production change during a low-order window.

Validate it works

Rendering is not validation. Put a real order through the staging block checkout using gateway sandbox credentials, and choose a cart that exercises your actual rules: a shipping zone that is not the default, a coupon, and a product that triggers whatever conditional fee or shipping logic you run.

Watch four things end to end. The order reaches processing or on-hold as it would in production. Every custom field you inventoried in step 2 appears on the order in WooCommerce > Orders, not just on the checkout screen. The customer and admin emails contain the same content they do on the classic checkout, including any custom field printed into the template. And the totals on the confirmation page match what the gateway sandbox actually captured.

wp post list --post_type=shop_order --format=table --fields=ID,post_status,post_date --posts_per_page=3
+----+-----------------+---------------------+
| ID | post_status     | post_date           |
+----+-----------------+---------------------+
| 84 | wc-processing   | 2026-08-24 10:12:44 |
+----+-----------------+---------------------+

On an HPOS store this listing comes from the orders table instead; wp wc shop_order list --user=1 reads it either way. Then roll staging back and confirm the rollback itself works, because an untested rollback is not a rollback:

wp post update "$(wp option get woocommerce_checkout_page_id)" --post_content="$(cat checkout-page-content.bak)"
Success: Updated post 7.

Troubleshooting

The block area is blank or shows a spinner forever. Open the browser network tab and look for the request to /wp-json/wc/store/v1/cart. A 403 with an HTML body is a security plugin or WAF rule; allowlist the wc/store namespace rather than disabling REST protection wholesale. A 404 on /wp-json/ entirely means permalinks are plain or the REST route is disabled at the theme level. A CDN rule that only allows GET on /wp-json/ breaks submission but not rendering, which produces the confusing version where the checkout draws fine and the pay button does nothing. Blank plus a JavaScript console error naming a script file usually means an optimisation plugin concatenated or deferred the block bundle incorrectly; exclude the checkout page from JS optimisation and retest before blaming Woo. Stale edge caching of cart state has its own failure signature, covered in the APO stale cart article.

A custom field is missing on the block. Expected, not a bug. The block does not read woocommerce_checkout_fields. Either the plugin that owns the field ships a Store API registration, or someone re-declares the field with woocommerce_register_additional_checkout_field() and writes the order-time handling against woocommerce_store_api_checkout_update_order_from_request. If the field is required for tax, compliance or fulfilment and nobody owns rewriting it, that is a stay-on-the-shortcode answer.

A gateway that works on the classic checkout is absent from the block. The gateway ships no block integration, meaning it never registers on woocommerce_blocks_payment_method_type_registration. There is no setting that fixes this. Check the plugin changelog, ask the vendor for a date, and keep the shortcode in the meantime.

The express payment area is empty even though the gateway appears below. Express buttons are a separate registration from the normal payment method, so a gateway can support one and not the other. Beyond that, express wallets have their own preconditions that have nothing to do with WooCommerce: the site must be served over HTTPS with a valid certificate, the domain often needs verification in the gateway dashboard, and the browser needs a saved card for the wallet to draw anything at all. Test in a browser where you know a wallet card exists before concluding the integration is broken.

Shipping or fee rules changed. Cart-level filters like woocommerce_package_rates and woocommerce_cart_calculate_fees still run, so if amounts changed, the cause is usually a plugin reading a checkout field that no longer arrives, or a rule keyed on a field the block collects in a different order. Check what the plugin reads before assuming the calculation itself moved.

When this is the wrong approach

A heavily customised checkout should stay on the shortcode. If your store adds several required fields, runs validation that blocks orders, prints custom data into packing slips, or depends on a gateway or subscription plugin that has not shipped block support, the block is not a better version of what you have; it is a smaller version, and the missing parts are the parts your operations team depends on. There is no deadline that makes shipping a checkout you have not tested a good trade.

The block is also the wrong first move when the underlying problem is speed. If checkout is slow because of database contention, a saturated PHP-FPM pool or an unindexed order table, the block renders the same slow cart calculation over REST instead of over a form post. Fix the server-side cause first; the block changes how the page feels, not how long a cart total takes to compute.

Finally, do not run this change and an HPOS migration, a theme change, or a gateway upgrade in the same window. Each of them can produce a missing-field or missing-gateway symptom, and running them together removes your ability to tell which one did it.

For the underlying references, the WooCommerce developer documentation covers the Store API and the additional checkout fields registration, and the WordPress REST API handbook explains the namespace behaviour that decides whether /wp-json/wc/store/ is reachable in the first place.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.