Search
Close this search box.

How to Disable Ajax in Divi Blog Module

Disabling Ajax on blog posts could enhance accessibility for users with disabilities. Ajax-driven interactions might not always be fully compatible with assistive technologies such as screen readers. These technologies rely on the underlying structure of web pages, and dynamic content loading through Ajax might not be properly conveyed to users who depend on assistive devices.

By disabling Ajax on blog posts, you ensure that all users, regardless of their abilities, can access your content without any barriers. This tutorial is specifically tailored for Divi Builder users, providing guidance on how to disable Ajax for your Divi Blog module. This modification will enhance the overall user-friendliness of your website and provide equal access to information for all visitors. So, without delay, let’s delve right into the process!

Disable Ajax in the Divi Blog Module

Depending on your preference for disabling Ajax on your Divi Blog module, there are several methods available. This tutorial will provide you with three options:

  • Disable Ajax for all Blog modules on your website
  • Disable Ajax exclusively for the Blog module on a specific page
  • Disable Ajax specifically for Blog modules with a designated custom CSS class

Disable Ajax for All Blog Modules

To disable Ajax for all Blog modules on your website, from your WordPress dashboard, navigate to Divi Theme Options → Integration then paste the following code to the Add code to the <head> of your blog code editor.

<script>
(function($) {
    $(document).ready(function() {
    
        $(".et_pb_module.et_pb_posts .pagination a, .et_pb_blog_grid .pagination a").click(function() {
            window.location.href = $(this).attr('href');

            return false;
        });
    
    });
})(jQuery);
</script>

Once the code is ready, click the Save Changes button to disable Ajax for the blog module.

Disable Ajax Exclusively for the Blog Module on a Specific Page

To disable Ajax exclusively for the Blog module on a specific page, you just need to add a Code module on that particular page and then add the following code inside the code editor provided.

<script>
(function($) {
    $(document).ready(function() {
    
        $(".et_pb_module.et_pb_posts .pagination a, .et_pb_blog_grid .pagination a").click(function() {
            window.location.href = $(this).attr('href');

            return false;
        });
    
    });
})(jQuery);
</script>

Disable Ajax Specifically for Blog Modules with a Designated Custom CSS Class

To disable Ajax on Blog modules that have a designated custom CSS class, start by navigating to Divi → Theme Options → Integration from your WordPress dashboard and copy the following code to the Add code to the <head> of your blog code editor.

<script>
(function($) {
    $(document).ready(function() {
    
        $(".customclass .pagination a").click(function() {
            window.location.href = $(this).attr('href');
            
            return false;
        });
    
    });
})(jQuery);
</script>

Replace ‘customclass‘ with the specific custom CSS class you’ve set for your Blog module. Afterward, click the Save Changes button to initiate the process of disabling Ajax on the Blog module associated with that CSS class.

Now, as you navigate through your blog post, the URL will change accordingly instead of remaining static, as it does when Ajax is enabled.

The Bottom Line

Enhancing website accessibility is not just a matter of compliance but a commitment to inclusivity. Disabling Ajax on blog posts, as outlined in the tutorial, is a proactive step toward ensuring that all visitors, including those with disabilities, can seamlessly access your content.

If you manage multiple WordPress websites powered by Divi, leveraging Divi Cloud can significantly streamline your workflow and save valuable time. This tool allows you to store not only the mentioned snippet but also various other Divi assets like layouts and templates. You can effortlessly load these elements onto any website you’re working on! enhancing efficiency and ensuring consistency across your projects.

This page may contain affiliate links, which help support our project. Read our affiliate disclosure.
Picture of Hendri Risman

Hendri Risman

Hendri is a WordPress expert and a writer staff at WPPagebuilders. He writes solutions on how to get things fixed in WordPress a lot. Mostly without involving a plugin.
Want to turn your WordPress knowledge into revenue? OF COURSE!

Leave a Comment

Share This
Save your Divi assets to the cloud and access them from anywhere.
Hey 👋🏻
Do you have a WP blog?
If so, you may need these. All the resources you need to grow your blog.

Your popup content goes here

50%

Where should we send the template?

After entering your email address, you will be added to our newsletter subscribers. You can unsubscribe anytime.

Want to Build Passive Income Like the One on the Screenshot Below?

Click the button on the right side to learn how 👉🏻
5 easy steps to turn your WordPress knowledge into monthly recurring revenue.

Click the above button to close the popup.