Skip to content

Instantly share code, notes, and snippets.

@michaeltieso
Created February 12, 2021 19:01
Show Gist options
  • Save michaeltieso/28e9eeebacca517ca84f71e175f3dc82 to your computer and use it in GitHub Desktop.
Save michaeltieso/28e9eeebacca517ca84f71e175f3dc82 to your computer and use it in GitHub Desktop.
# Code to make sure WooCommerce Subscription URL does not update during a Search and Replace script.
# Add to your themes functions.php file
# Replace https://example.com with your live URL
if (class_exists('WC_Subscriptions')) {
function wc_subs_live_url() {
update_option( 'wc_subscriptions_siteurl', 'https://example.com' );
}
add_action('init', 'wc_subs_live_url');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment