After identified the culprit causing your website loading speed slow and confirmed that it’s due to Malaysia MCMC blocked , let me show you how to replace the culprit javascript or css file in WordPress.
Prerequisite
- You have identified the culprit javascript or css and found the script path via developer tool inspect element tab.
- You are confirmed that the culprit javascript or css unable to load is because of blocking by Malaysia MCMC.
Install Replace Asset Source WordPress Plugin
As usual, go to your WordPress wp-admin and navigate to Plugins > Add New. Search for Replace Asset Source. Install and activate the plugin. Then go to Settings > Replace Asset Source. You will be able to see the screen as below.
Add New Asset Replacement Setting
Now, just simply hit the New Replacement button and set the culprit javascript or css in the Target Asset Url field, and set another alternative working javascript or css in the Replacement Asset Url field.
**You could find many alternative cdn source from google, or you could head to cdnjs to get yours. **
**You must remove the version string from the culprit source.**
**You must follow the exact path of the culprit source, either contains https, http or empty protocol, just copy whatever you got from inspect element tab, otherwise the plugin might not be able to help you find and replace.**
Example:
My culprit script is https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css?ver=5.8.2, I should set the Target Asset Url as https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css
And I will set the Replacement Asset Url as https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
So the final setting as below.
Next, just tick the Activate Asset replacement checkbox and click Save button.
Replacement Successfully
After that, just navigate to your front end and inspect your page again, you will noticed that the culprit script gone and replaced by your source as expected. If it’s not working, please check whether you are using cache plugin and purge the cache. Ensure you got no typo in on both Target Asset Url and Replacement Asset Url as well.
This Replace Asset Source WordPress plugin was written by me, my objective is to help WordPress owners who are not familiar with coding but still able to solve the slow website loading speed issue especially from Malaysia. To coders, you can just simply dequeue the culprit source and enqueue yours by using coding way anytime.
Thank you so much for your effort to help up the local community~