Skip to content

Instantly share code, notes, and snippets.

@webaware
Last active June 29, 2018 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webaware/17be2cb59f2cfe1313d6 to your computer and use it in GitHub Desktop.
Save webaware/17be2cb59f2cfe1313d6 to your computer and use it in GitHub Desktop.
Exclude WooCommerce sessions from WP Migrate DB Pro migration
<?php
/*
Plugin Name: WP Migrate DB Exclude Woo Sessions
Plugin URI: https://gist.github.com/webaware/17be2cb59f2cfe1313d6
Description: Exclude WooCommerce sessions from migration
Version: 0.0.1
Author: WebAware
Author URI: http://webaware.com.au/
*/
add_filter('wpmdb_rows_where', function($where, $table) {
global $wpdb;
if ($table === $wpdb->options) {
$where .= " AND option_name NOT LIKE '\_wc\_session\_%'";
}
return $where;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment