Storing WooCommerce Terms & Conditions in the Database

Remi | February 18, 2014 | in WooCommerce

WooCommerce provides a nice feature that force your customers to accept your terms and conditions if you define the corresponding page within WooCommerce settings. If your customers don’t check the “terms and conditions”, they can’t proceed the order. This is nice and easy to setup.

Setup the Terms & Conditions Page

Just a quick reminder on how to set this up. First of all, create a new page, call it “Terms” (or what you want!), add your content, then go to WooCommerce > Settings > Checkout in WC 2.1.x or to WooCommerce > Settings > Pages for versions below 2.1. Then choose the page you just created in the corresponding dropdown select and save settings.


And here is what your customers will see on the checkout page:


Nice but…

That’s pretty neat right? But what happens when one your customer has a litigation with you? Can you prove that your customer accepted your terms and conditions? The answer is not that simple. You can still say that it’s impossible to purchase on your site without accepting your terms and conditions, but legally, it is not enough.

The solution, is to add a snippet to your site that will store the “terms and conditions” field value within the database, and in that case you can prove that terms and conditions were accepted, order by order.

Simply add this code to the functions.php file within your theme folder:

This code will store the field value within the database, and will also print this information on the “edit order” page:


The author

About the author Remi: Hey! My name is Rémi Corson, i'm a WordPress Expert Developer, i create high level themes and plugins, and i provide free stuff every week on this website!


  1. tosun

    Thanks for your sharing, it is useful.
    But, I ask you some more point about this subject.
    It is good idea to store at database and show at order.
    But, I want to add some shortcodes to term&cond. page like below ;
    [customer-name] , [customer-address] , [woocommerce-order-date] ,[woocommerce-shipping-name] , [woocommerce-shipping-address], [woocommerce-shipping-phone] , [woocommerce-shipping-mail]

    How can I do this?

  2. rohilmistry

    What if I want to make it editable field in the backend ? So that admin can modify it just like Billing Address.

    I meant when you click edit icon on right hand side of BILLING ADDRESS, then it will show you a form so is that possible to achieve the same for the custom field.

  3. videomicloud

    I know this is an old post…but it addresses exactly what my client needs, which is to store some sort of proof that customers agreed to the terms and conditions. I”ve implemented the code using the code snippets plugin (which works great for a couple other functions file customizations)…but I can’t get this to work. My guess is because of changes in Woocommerce core since this was first posted. So guess I’m asking if this method still works to your knowledge? If it does..I’m currently testing this site before going live and using’s sandbox mode. Could that possibly cause things to not work?? Thanks…I’m an experienced WordPress developer but self-taught with PHP programming. I can do simple stuff typically.

    Chris Blair

Leave a reply