Last active
June 4, 2021 13:20
-
-
Save cjj25/d28542c2f87959df5f0f1093e22dc27a to your computer and use it in GitHub Desktop.
Disable SEO Framework from running on WooCommerce Checkout routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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