How to Reorder WooCommerce Product Page Elements Without a Plugin
Rearrange WooCommerce product prices, descriptions, and add-to-cart buttons in classic product templates using PHP hooks, without installing a plugin.
Last updated:
Reviewed for accuracy by Jesse Nickles
Check which product layout you use
Before changing PHP, check how the Single Product page is built. In a block theme, go to Appearance → Editor → Templates → Single Product and inspect List View. If the price and description are separate, editable blocks, you can move them in the Site Editor and save the template. A template containing a single woocommerce/legacy-template block instead renders the classic PHP layout, so the hook method below can still apply. Classic themes such as HoverCraft also use PHP product templates. WooCommerce's product-page theming documentation explains the two layouts.
Move the price below the short description
- Back up your store and test the change on staging before editing PHP.
- Open
functions.phpin your active child theme. If you need one, follow HoverCraft's Child Themes documentation. Do not edit the parent theme: its updates can overwrite your changes. - Paste the snippet inside the existing PHP code without adding another
<?phptag. Replacemyshopin the function name and the finaladd_action()call with a prefix unique to your site.function myshop_move_product_price() { if ( ! function_exists( 'is_product' ) || ! is_product() ) { return; } remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 25 ); } add_action( 'wp', 'myshop_move_product_price' ); - Save the file and check several product pages, including a variable product.
The wp action runs after WordPress identifies the page, allowing is_product() to limit the change to individual products. The snippet removes the price callback at its original priority 10 and adds it back at 25, between the short description at 20 and Add to Cart at 30. It changes the display order, not the product price.
Default order of product summary elements
Classic WooCommerce product templates use the woocommerce_single_product_summary action to display product details. Its functions, or callbacks, run in priority order: lower numbers run first. The values below are WooCommerce defaults, not guaranteed positions in a customized theme.
| Element | Callback | Priority |
|---|---|---|
| Product title | woocommerce_template_single_title | 5 |
| Rating | woocommerce_template_single_rating | 10 |
| Price | woocommerce_template_single_price | 10 |
| Short description | woocommerce_template_single_excerpt | 20 |
| Add-to-cart controls | woocommerce_template_single_add_to_cart | 30 |
| SKU and product metadata | woocommerce_template_single_meta | 40 |
WooCommerce lists these defaults in its classic product template. Rating and price both have priority 10; their order at that priority depends on registration order. Themes and extensions can also remove or move callbacks.
Move another summary element
Use the table to identify the callback and the priority you need to remove. For example, to move the short description below Add to Cart, replace woocommerce_template_single_price in both calls with woocommerce_template_single_excerpt, change the remove_action() priority from 10 to its original 20, and keep the add_action() priority at 35 instead of 25. The description then appears after Add to Cart at 30 and before product metadata at 40. If you create a separate snippet, use a different, unique function name.
These hooks rearrange the classic product summary, not the gallery or the whole page. If you only need a message below the purchase controls, HoverCraft's After Add To Cart widget area is simpler and does not require PHP.
If the order does not change
- Nothing moves: Confirm the child theme is active, the snippet loads without a PHP error, and the product page uses classic hooks or the legacy template rather than individual product blocks. Clear relevant page caches.
- Wrong order or duplicate output: Check that
remove_action()uses the exact callback and its current priority. A theme or plugin may already have moved that callback or added another output function. - PHP error after saving: Restore the last working snippet and check the syntax on staging before trying again.
To undo the change, remove the snippet and restore any other callback customizations you changed.