Skip WooCommerce Orders and Products
Whenever you use WP Staging Pro to push changes from 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, transactions, 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, user data like customer address and all other data like posts and pages:
- Orders and products are stored in table
wp_postmetaseparated by the custom post type ‘orders’
- WordPress itself also stores all its data like pages and posts in the same tables.
- Users are stored in
There are also a bunch of other WooCommerce custom tables which store things like tax rates, order items, and general WooCommerce settings.
Each table name will be prefixed with a certain table prefix e.g.
The WooCommerce table names will be prefixed with the same table prefix but they also begin with
The number in the prefix is the number of your staging site. So if you have multiple staging sites that number will be counted up like
wpstg2_ and so on.
If you want to migrate certain data from your staging site to the production site without affecting any of the transactional data you have two options:
A) Exclude relevant tables before you using the WP Staging push process. If you go that route you can not migrate the entire staging site including all of its data! Depending on the excluded table (e.g. _posts, _postmeta) this can lead to missing images and even layout elements on your production website.
B) Export first, orders and transactional data from the live site and import them into the staging site before migrating the staging site to live.
This allows you to copy over the entire staging site.
C) Exclude all database tables except the table
_options and select only the plugins and themes folder you like to push to the staging site. Going this route way ensures that you never overwrite or lose data on the production site which has been generated after creating the staging site. Most of the plugins also store their plugin settings in the table
_options. So this will also migrate the plugin settings to the live site as well.
Note: Any other missing data which is included in the tables
_postmeta table needs to be created again on the live site by yourself manually.
Note: Option B and C are the recommended and more reliable ways!
To skip WooCommerce orders you need to exclude the tables below before you push the staging site to the production site:
All tables beginning with:
The huge drawback is that this also excludes posts and articles and any other data that is stored in the tables _posts and _postmeta on our WordPress site. For instance, WordPress stores menu entries and all other custom post type data in these tables as well.
Export & Import WooCommerce Orders
So the better option is to export first your orders and products data with a separate export/import plugin from the production site and then to import them into the staging site before you do the push.
There are several plugins to do that job.
One of them is the one by WebToffee
(If you know another reliable import/export plugin please let us know)
Keep in mind that exporting and importing orders will likely change the order id of most of the new orders due to the reason that the WooCommerce order id is the same as the post id which is a unique number in WordPress.
So if the post id on your staging site is already used, the imported order gets a new id which results in a new order id.
So if you like to keep the order id you need to use another plugin which adds a new database entry that stores the order id in a separate field that allows you to have that order id separated from the post id.
Before you push the staging site make sure to set your website into maintenance mode or to disable the shop system to make sure that no orders come in while you push data from the staging site to live.
Read also this ongoing in-depth and technical article about migrating WooCommerce orders from one site to another:
Before you export and import any orders from your live site to live it’s strongly recommended to create another staging site to test this whole process before you do the import and export on the real staging website!
See also: WooCommerce database table reference
Keywords: WP Staging + WooCommerce, WP Staging Exclude WooCommerce Orders, Exclude WooCommerce Products