Title: Redirecting after Purchasing
Last modified: August 21, 2016

---

# Redirecting after Purchasing

 *  [Boatshoes](https://wordpress.org/support/users/boatshoes/)
 * (@boatshoes)
 * [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/)
 * Hi, Thank you for the plugin
 * I am trying to redirect to another page after people purchase my product. I have
   seen on other forms that people ask the same question and people answer with 
   just posting code and I dont know what to do with the code….as you might be able
   to understand I am not an expert, can some one help me understand what to do?
 * Thank you
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Boatshoes](https://wordpress.org/support/users/boatshoes/)
 * (@boatshoes)
 * [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/#post-4843086)
 * I was wondering how to redirect people after checking out? there is some code
   in the form already but it doesnt tell you where to put it? Can some one help?
   thank you
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/#post-4843092)
 * In general terms, you should first [create a child theme](http://codex.wordpress.org/Child_Themes).
   This is so your primary theme can be updated in future without overwriting any
   customisations. Next, you should create a file called functions.php in your child
   theme, and you use this file for your custom code. Any code in your child theme’s
   functions.php is executed before code in functions.php in the primary theme.
 * I have not seen your code. It might not be what I envisage. Perhaps you could
   post a link to what you have seen.
 *  Thread Starter [Boatshoes](https://wordpress.org/support/users/boatshoes/)
 * (@boatshoes)
 * [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/#post-4843093)
 * Thank you for your help
 * [http://wordpress.org/support/topic/redirect-after-checkout-in-woocommerce?replies=15](http://wordpress.org/support/topic/redirect-after-checkout-in-woocommerce?replies=15)
   
   This is the thread where they are talking about it…but I dont need a different
   redirect for every product.
 * Thank you
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/#post-4843094)
 * OK, create a child theme as above but you don’t need functions.php, not for this
   task anyway.
 * The thread you quote gives 2 methods for redirects, the first applies to every
   product and I think that’s the method you want. The second is on a per product
   basis and I don’t cover it here.
 * Look for this file:
 *     ```
       wp-content/themes/YOUR_CHILD_THEME/woocommerce/checkout/thankyou.php
       ```
   
 * If it doesn’t exist, make the sub-directories if you need to, and copy the file
   from:
 *     ```
       wp-content/plugins/woocommerce/templates/checkout/thankyou.php
       ```
   
 * to
 *     ```
       wp-content/themes/YOUR_CHILD_THEME/woocommerce/checkout/thankyou.php
       ```
   
 * At this point, your customization will not be lost if you update WooCommerce.
 * Add something like this at the end of thankyou.php: (Use a plain text editor,
   not MS Word)
 *     ```
       <script>
       window.location = 'http://redirect-to-this-page';
       </script>
       ```
   
 * Of course alter the url to suit.
 * If you get blank pages, your new file has a syntax error. Just rename your new
   thankyou.php to something else and that should get you going again.
 * Unfortunately if it doesn’t work, debugging from this distance may not be easy,
   but post your url.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Redirecting after Purchasing’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * 4 replies
 * 2 participants
 * Last reply from: [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/redirecting-after-purchasing/#post-4843094)
 * Status: not resolved