Skip WooCommerce Orders and Products

Skip WooCommerce Orders and Products

When you use WP Staging Pro to push changes to the staging site to the live site you need to make sure that WooCommerce Orders, WordPress users, and WooCommerce products on the live site are not affected in any way.

You also need to make sure that if you make changes to the staging site and then push the changes, any orders and users that were added in the interim will remain untouched.

So what is the best way to prevent those data from being overwritten during the pushing process?

First of all, we need to understand where WooCommerce and WordPress are storing transactional orders,  products data, and user data like customer address and so on.

  • Orders and products are stored by custom Post Types in table wp_posts and wp_postmeta
  • Users are stored in wp_users and wp_usermeta

There are also a bunch of other WooCommerce custom tables which are storing things like tax rates, order items, and general WooCommerce settings.

Each table name will be prefixed with a certain table prefix e.g. wpstg1_

The WooCommerce table names will be prefixed with the same table prefix but they also begin with _woocommerce like wpstg1_woocommerce_

The number 1 is the number of your staging site. So if you have multiple staging sites this number will be counted up like wpstg1_, wpstg2_ and so on.

So, if you want to push your staging site to the live one without affecting any of the transactional data on the live site exclude the following tables before you start WP Staging pushing process:

  • wpstg1_posts
  • wpstg1_postmeta
  • wpstg1_users
  • wpstg1_usermeta
    All tables beginning with:
  • wpstg1_woocommerce_

The drawback is that this would also exclude posts and articles and any other data that is stored in custom post tables on your WordPress site.

One way around this would be to export first your orders and products data with a separate export plugin from the production site and then to import them on the staging site before you do the push.

After that, set your production site to maintenance mode to make sure that no order comes in while you do the push and start the pushing process.

See: WooCommerce database table reference

Keywords: WP Staging + WooCommerce, WP Staging Exclude WooCommerce Orders, Exclude WooCommerce Products