Disable Ajax loading on a page

There are limited cases where the AJAX dynamic loading conflict with 3rd party plugins and affect how the website loads. For example, if your WooCommerce shop has different product variations, AJAX loading can prevent some WooCommerce functions from loading, breaking the shopping experience.

To disable AJAX loading on a certain page, add the code below in Appearance → Customize → Theme Options General → Custom Javascript (Footer).

if ( Array.isArray( window.djax_ignored_links ) ) {
    window.djax_ignored_links.push( 'page-slug' );    
} else {
    window.djax_ignored_links = [ 'page-slug' ];
}

Replace the page-slug with a part of the URL where you want AJAX removed. For example, if the problem is on the single product page and your URL looks like this https//domain.com/product/tshirt, your code should be be:

if ( Array.isArray( window.djax_ignored_links ) ) {
    window.djax_ignored_links.push( 'product' );    
} else {
    window.djax_ignored_links = [ 'product' ];
}

Updated on June 3, 2022

Can't find what you’re looking for? Ask a human.

We're a small team of real people providing real help. Send us an email at [email protected] and we will give you a helping hand.