Skip to content

Instantly share code, notes, and snippets.

@cjj25
Last active June 4, 2021 13:20
Show Gist options
  • Save cjj25/d28542c2f87959df5f0f1093e22dc27a to your computer and use it in GitHub Desktop.
Save cjj25/d28542c2f87959df5f0f1093e22dc27a to your computer and use it in GitHub Desktop.
Disable SEO Framework from running on WooCommerce Checkout routes
<?php
# Place this file in the ROOT of wp-content/mu-plugins
# If the folder doesn't exist, create it.
$do_not_load_seo_framework_routes = [
'/checkout/',
'/basket/',
'/?wc-ajax=update_order_review',
'/?wc-ajax=add_to_cart',
'/?wc-ajax=checkout',
'/?wc-ajax=get_refreshed_fragments'
];
foreach ($do_not_load_seo_framework_routes as $URI) {
if (strpos($_SERVER['REQUEST_URI'], $URI) === false) continue;
add_filter('the_seo_framework_load', "__return_false");
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment