Remove Product Permalink from Thank You Page in WooCommerce

In WooCommerce, the Thank You page typically displays order details, including product names linked to their respective permalinks. However, you may want to remove these permalinks for various reasons, such as simplifying the layout or improving the user experience. In this tutorial, we’ll learn how to achieve this using a simple code snippet.

/**
 * Snippet Name:  Remove Product Permalink from Thank You Page
 * Snippet URL:  wpsnippets.dev
 */

// Remove product permalink from Thank You page
add_filter( 'woocommerce_order_item_permalink', '__return_false' );

Code Explanation

  • The code snippet below utilizes a WooCommerce filter hook called woocommerce_order_item_permalink.
  • By hooking into this filter and returning false, we effectively prevent the product permalinks from being displayed on the Thank You page.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top