WooCommerce Won't Let You Set Cart and Checkout to the Same Page? Bypass the Restriction (2025 Fix)
July 9, 2026
6 min read
How the Error Looks and Why It Happens
Since WooCommerce 3.7 (released in 2019), the system prevents you from selecting the same WordPress page for both the Cart and Checkout in WooCommerce > Settings > Advanced. If you try, the dropdown will simply reset to the previous value without any visible error message. This restriction was introduced to avoid logical conflicts—for example, when using shortcodes or blocks, the same page can't serve both roles because WooCommerce needs distinct page IDs for redirects and URL-based detection. However, many store owners want a single checkout page to streamline the purchase flow (cart and checkout on one page) and reduce cart abandonment. The restriction is enforced in the admin UI but not at the database level, so you can still bypass it with a small code snippet or a dedicated plugin.
Step-by-Step Solution
- 1Create a new WordPress page (or use an existing one) and add both the [woocommerce_cart] and [woocommerce_checkout] shortcodes (or the corresponding blocks).
- 2Add the custom code snippet from above to your theme's functions.php or a custom plugin (use a child theme if needed).
- 3Go to WooCommerce > Settings > Advanced, and select the same page for both Cart and Checkout. The dropdowns should now allow the same page.
- 4Save changes and clear any site/plugin cache.
- 5Test the combined page by adding a product to cart and proceeding to checkout – it should show cart contents followed by the checkout form.
- 6If the shortcodes don't display correctly, ensure the page is set to 'Default Template' or a full-width template, and check for theme conflicts.
- 7Verify that redirects work: users should see the cart/checkout page after adding an item, and the order review should function normally.
// Add this code to your theme's functions.php or via a custom plugin.
// It removes the admin UI restriction and allows the same page for Cart and Checkout.
add_filter( 'woocommerce_settings_pages', function( $settings ) {
foreach ( $settings as &$setting ) {
if ( isset( $setting['id'] ) && in_array( $setting['id'], array( 'woocommerce_cart_page_id', 'woocommerce_checkout_page_id' ) ) ) {
// Remove the 'options' parameter that enforces uniqueness
unset( $setting['options'] );
}
}
return $settings;
}, 20 );
// Alternatively, you can use this filter to manually allow the same page ID:
add_filter( 'woocommerce_page_id', function( $page_id, $page ) {
// $page can be 'cart' or 'checkout'
// If you want to force a specific page for both, return that ID.
// Example: return 42; // your combined page ID
return $page_id;
}, 10, 2 );Final Recommendation
Best Practice
While the code solution works, it's not officially supported and may break with future WooCommerce updates. For a safer, more maintainable approach, use a dedicated plugin like 'WooCommerce Cart & Checkout Same Page' or 'WooCommerce Single Page Checkout'. These plugins handle the complexity and ensure compatibility. If you choose the custom code route, always test on a staging site first and keep the code updated. This setup is ideal for stores seeking a minimal, fast checkout flow, but be aware that combining both pages may confuse some users who expect separate steps – consider A/B testing to confirm it improves conversion rates.
Motions Studio Team
WordPress developer specializing in debugging, WooCommerce optimization, and PHP compatibility fixes.
