Skip WooCommerce Orders and Products
Whenever you use WP Staging Pro to push changes from the staging site to the live website, you need to make sure that WooCommerce orders, customers, and products on the live site are not affected in any way and that they remain untouched.
So what is the best way to prevent those data from being overwritten during the pushing process?
The short answer is that you can not merely exclude this data from pushing your staging site, but fortunately, there is still a way not to lose your orders and products on the production site:
First of all, we need to understand where WooCommerce and WordPress store orders, product, user data like customer addresses, and all other data like posts and pages:
- Orders and products are stored in the tables
wp_postmetaseparated by a custom post type field named ‘orders.’
- WordPress itself also stores most of its data like pages, posts, and even menu entries and everything else in the same tables
- Users are stored in
There are also a bunch of other WooCommerce custom tables that contain data like tax rates, order items, and general WooCommerce settings.
Each staging site table name begin with the prefix
The WooCommerce table names begin with the same table prefix, but they also start with
The x in the table 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 specific data from your staging site to the production site without affecting any of the transactional data, you have three options:
A) Export orders, user data, and other transactional data from the live site and import them into the staging site before migrating the staging site to live.
That allows you to copy the entire staging site.
This is the recommended way if you have no or less knowledge about the internal database structure. We explain below how this can be done.
B) Exclude all database tables except the table
_options and select only the plugins and themes folder you want 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.
Important: Any other missing data which is included in the tables
_postmeta table needs to be created again on the live site by yourself manually after pushing.
C) Exclude all modified database tables from the push process. If you go that route, you are not going to migrate the entire staging site, including all of its data!
Depending on the excluded tables (e.g. _posts, _postmeta) this can lead to missing images and even layout elements on your production website. Especially if you use a visual editor like WPBakery (formerly known as the visual composer) or Elementor because these editors store their designs in the tables _posts and _postmeta as well.
Note: Option A and B are the recommended and more reliable ways!
So, for example, if you’d like to skip WooCommerce orders and products from pushing you’d need to exclude the tables below before you push the staging site to the production site:
All tables beginning with:
Important: This excludes posts, articles, and any other data that is stored in the tables _posts and _postmeta on our WordPress site. For instance, pages, posts, menu entries, and all other custom post type data.
Export & Import WooCommerce Orders
So the better option is to export your orders first and product data with a separate export/import plugin from the production site and then to import the data back into the staging site before you do the push.
- Put your website in maintenance mode
- Use a plugin to export WooCommerce orders from the live site just before the push changes process.
- Import them into the staging site.
- Push changes from the staging site to the live one.
There are several plugins to do the exporting for you.
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 could change the order id of new orders due to the reason that the WooCommerce order id is based on 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.
For most store owners, this might not be an issue, but if you need to keep the order id, you’ll need to use another plugin which adds a new database entry that stores the order id in a separate field and 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