The WooCommerce checkout shortcode is a small piece of text that displays the checkout form on a WordPress page. If you are setting up an online store, it helps connect your cart to the page where customers enter their details, choose a shipping method, and pay for their order. Although newer WooCommerce stores may use the Checkout block instead, the shortcode remains useful for legacy stores, custom page layouts, and situations where a shortcode-based checkout is required.
Understanding what the shortcode does—and what it does not do—can make checkout setup easier. This guide explains the WooCommerce checkout shortcode, how to use it, how it differs from the Checkout block, and what to check if the checkout page is not working properly.
What Is the WooCommerce Checkout Shortcode?
The WooCommerce checkout shortcode is [woocommerce_checkout]. When WordPress processes it on a page, WooCommerce displays its checkout form in that location. Customers can review their order, enter billing and shipping information, select available delivery options, and choose a payment method.
A shortcode is a WordPress instruction placed inside a page’s content. Rather than showing the text itself to visitors, WordPress asks the relevant plugin—in this case, WooCommerce—to generate the appropriate content. The checkout shortcode therefore acts as a link between a WordPress page and WooCommerce’s checkout functionality.
The shortcode does not create a complete checkout system on its own. It relies on WooCommerce being installed and configured, products being available to purchase, and payment and shipping settings being in place. It also needs to appear on a suitable page that customers can reach during the purchase process.
What Does the Shortcode Display?
The checkout content can vary based on the store’s settings, the products in the cart, the customer’s location, and the extensions installed on the site. In a typical store, the checkout page may include:
- Billing fields, such as a customer’s name, address, email address, and phone number.
- Shipping fields when shipping is relevant and enabled.
- An order summary showing products, quantities, and prices.
- Shipping methods available for the customer’s address.
- Payment options configured in WooCommerce.
- Fields for a coupon code, order notes, or other information, depending on the store setup.
- A button that lets the customer place the order.
The shortcode supplies the checkout interface, but it does not determine which payment gateways or shipping options appear. Those are controlled by WooCommerce settings and, in many cases, by the relevant payment or shipping extensions.
How to Add the WooCommerce Checkout Shortcode
Before adding the shortcode manually, check whether WooCommerce has already created a checkout page. During setup, WooCommerce may create essential store pages automatically, including Cart, Checkout, and My account. You can find the assigned checkout page under WooCommerce > Settings > Advanced. Page names and settings may differ slightly across WooCommerce versions.
If you need to create or replace the page, use these steps:
- In your WordPress dashboard, go to Pages > Add New, or open the page you want to edit.
- Add a Shortcode block in the WordPress block editor. In the Classic Editor, place the shortcode in the page content.
- Enter
[woocommerce_checkout]in the block or content area. - Publish or update the page, then assign it as the checkout page in WooCommerce settings if it is not already assigned.
- Test the page on the front end with a product in your cart.
Use the Shortcode block rather than a code or preformatted block. The latter may display the shortcode as text instead of running it. If you use a page builder, add the shortcode through its dedicated shortcode element or a compatible text element.
Does the Shortcode Need Attributes?
For the standard WooCommerce checkout page, the shortcode is used without extra attributes: [woocommerce_checkout]. It is not generally necessary to add settings for billing fields, payment methods, or shipping options inside the shortcode. Those parts of checkout are managed elsewhere in WooCommerce.
Adding unsupported attributes or changing the shortcode may not produce the result you expect. If you need to alter checkout fields, layout, or behavior, look for the relevant WooCommerce setting, a compatible extension, or a developer-approved customization. Always check that a solution supports your version of WooCommerce and your checkout type.
Shortcode Checkout vs. the WooCommerce Checkout Block
WooCommerce also offers a Checkout block, which provides a block-based way to build checkout pages. The block and the shortcode are different ways to present checkout functionality. A store’s available options can depend on its WooCommerce version, theme, extensions, and existing page setup.
The Checkout block may be a good fit if you want to edit the checkout page using the WordPress block editor and your payment gateways and extensions support it. The shortcode can be useful when a store already relies on a classic checkout page, a page builder, or an extension designed to work with the shortcode-based checkout flow.
Do not assume that every extension works identically with both approaches. Before switching a live store from a shortcode page to the Checkout block—or the other way around—review compatibility information from the extension providers. Test the new page with a staging site or a safe test order, especially if your store uses custom checkout fields, subscriptions, bookings, or unusual payment methods.
When Should You Use the Checkout Shortcode?
The shortcode is a practical choice when you need a straightforward WooCommerce checkout page or when your store’s existing setup depends on it. Common reasons to use it include:
- You are restoring a checkout page that was deleted or has missing content.
- Your theme, page builder, or checkout extension expects the classic shortcode-based checkout.
- You are maintaining an older WooCommerce store and want to avoid changing a working checkout without a clear reason.
- You need to add checkout functionality to a page where the shortcode is supported.
It is not a shortcut for building a separate checkout process from scratch. The page still uses WooCommerce’s configured checkout behavior, and the customer generally needs to have a product in the cart before there is an order to review.
How to Check Whether the Checkout Page Is Working
A page can be published and still fail to work as a checkout page. The best way to check it is to follow the same steps a customer would take. Add a product to the cart, continue to checkout, and confirm that the page displays the expected fields and order information. Test different scenarios if your store has multiple shipping zones, payment methods, or product types.
For a thorough checkout test, confirm that:
- The page is assigned as the checkout page in WooCommerce settings.
- The shortcode appears as a rendered checkout form, not as visible shortcode text.
- Products in the cart appear in the order summary with the correct quantities and prices.
- Relevant billing, shipping, and payment fields are available.
- Shipping rates and taxes behave as expected for test addresses.
- The place-order process completes with a test payment method or a payment gateway’s test mode.
- The customer receives the expected order confirmation, if email notifications are configured.
Do not rely only on viewing the page while logged into WordPress. Test as a customer, preferably in a private browser window, and avoid placing a real order unless you intend to complete the payment.
Common Checkout Shortcode Problems
The shortcode appears as plain text. This usually means it was entered into a block or page element that does not process shortcodes. Move it into a Shortcode block or a supported shortcode element, then update the page.
The page is blank or the checkout form is missing. Confirm that WooCommerce is active, that the page contains the correct shortcode, and that the page is assigned as the checkout page. A plugin conflict, theme issue, or caching problem can also interfere. Temporarily test with a compatible theme and disable nonessential plugins on a staging site to help identify the source.
The checkout page shows an error or behaves unexpectedly. Check for recent changes to WooCommerce, your theme, payment gateways, and checkout-related extensions. Review WooCommerce logs and the site’s error logs if available. Update compatible software and test changes away from the live store before applying them to production.
Customers cannot see a payment method. The shortcode does not enable payment gateways. Review the gateway’s settings, supported currencies, store location, and any conditions that control when it appears. Some gateways also require an account connection or additional configuration.
Checkout changes are not visible. Clear page, browser, and server caches, and check whether an optimization tool is delaying or combining scripts needed by checkout. Checkout pages should be configured carefully in caching plugins so that customer-specific cart and checkout information is not served incorrectly.
Can You Customize a Shortcode Checkout Page?
You can often customize the surrounding page with your theme or page builder, but the checkout form itself has WooCommerce-specific behavior. Extensions may let you add, remove, or rearrange fields, change the layout, or provide extra checkout options. A developer can also make customizations using supported WooCommerce hooks and templates.
Avoid editing WooCommerce plugin files directly. Updates can overwrite those edits, and an unsupported change may cause checkout errors or expose customer information. Use a maintained extension or a child theme where appropriate, and have custom code reviewed and tested by a qualified developer. Keep the checkout easy to use: unnecessary fields and confusing layouts can make it harder for customers to complete an order.
SEO and User Experience Considerations
The checkout page is primarily for completing purchases, not for attracting search traffic. Keep its purpose clear and focus on a fast, trustworthy, mobile-friendly experience. Use a descriptive page title, make sure important checkout controls are easy to find, and avoid placing distracting content between the cart and the order button.
Checkout pages contain personalized order information, so they should not be treated like ordinary public content. Follow WooCommerce and caching-plugin guidance for excluding cart and checkout pages from inappropriate caching. Use HTTPS across the site, keep WooCommerce and payment extensions updated, and collect only the customer information your business needs.
Frequently Asked Questions
What is the exact WooCommerce checkout shortcode?
The standard shortcode is [woocommerce_checkout].
Where should I put the shortcode?
Place it in the content of the page assigned as your checkout page. In the block editor, use a Shortcode block.
Can I use the shortcode on more than one page?
You may be able to display checkout on another page, but WooCommerce should have a clearly assigned checkout page. Multiple checkout pages can confuse customers or extensions, so use one main checkout destination unless you have a specific, tested reason to do otherwise.
Is the shortcode still useful if WooCommerce has a Checkout block?
Yes. It remains useful for compatible legacy setups and extensions. Choose the checkout method that works with your store’s theme and extensions, and test it before changing a live checkout.
Conclusion
The WooCommerce checkout shortcode, [woocommerce_checkout], displays the checkout form on a WordPress page. It is simple to add, but it depends on WooCommerce settings, payment and shipping configuration, and compatible site components to work correctly. Use a Shortcode block, assign the page in WooCommerce settings, and test the full customer journey before relying on it for sales. Whether you use the shortcode or the newer Checkout block, a reliable, clear, and secure checkout helps customers complete their orders with confidence.
0 comments