How to remove widgets.js script from blogger templates

How to remove widgets.js script from blogger templates


Hi everyone, If you have a blog on the Blogger platform and are interested in making your blog faster for visitors, it is obvious that you will check the speed of your blog through the speed check tool provided by Google PageSpeed Insights.

remove blogger widget.js
Remove blogger widget.js


So, when you perform a speed check, you will see many tips to increase the speed of browsing your site and some problems that are the reason for the slow loading of your site when visitors browse it.

You may find among one of these problems the problem of downloading the external JavaScript file widgets.js, which greatly affects the speed of your site, especially if you have a free blogger template or even if you bought a paid template or got it in some way, then you will notice the widgets.js JavaScript call code like this "<script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/2772432204-widgets.js">< /script>" which reduces the site's speed by about five degrees.

blogger widget.js
blogger widget.js 


So, the first thing that will come to your mind is to delete this code to increase the speed of loading your site, but the question that will come to your mind is: Will its deletion affect the work of the template for your site?

Currently; If you search in google you will not find the correct way to remove the tool as I did, I will make the search easier for you, and I will give you an easy way and just add one attribute to your template code and your problem will be over for good.

How to remove the widget.js script from blogger templates.

it's simple steps you need, just follow the instructions and all will be done.

1- Go to blogger.com and select the target blog from the left sidebar.
2- Go to Theme → Edit HTML and search for "<html".
3- Add this HTML attribute inside it b:js='false' like the image below.

remove blogger widget.js
remove blogger widget.js

4- Save the template.

Now if you open your page by using view-source: in your browser, you will see the script has gone, and the speed of your site will increase.

But, you will face a new problem on your site, what is it?.

The problem is that your contact us form will no longer work, and also some unimportant plugins, all we are interested in here is to solve the problem of the contact us form, and also you will face a problem with your blog layout page.

Fix Contact Us form problem

You will need to add additional code to your template for the Contact Us form to work on your site. This code allows calling the JavaScript files needed to run the contact form on Blogger blogs.

Follow me on how to add the code to fix the problem of the contact form in Blogger blogs step by step.

Step 1: Go to Theme → Edit HTML and search for "</body>.

step 2: add the bellow code before "</body>" element.

<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + &quot;p/contact-us.html&quot;'><script src='https://www.blogger.com/static/v1/widgets/2575128383-widgets.js' type='text/javascript'/> <script type='text/javascript'> _WidgetManager._Init(&#39;//www.blogger.com/rearrange?blogID\x3d3298931441472502692&#39;,&#39;//hackinguniversity.in&#39;,&#39;3298931441472502692&#39;); _WidgetManager._RegisterWidget(&#39;_ContactFormView&#39;, new _WidgetInfo(&#39;ContactForm1&#39;, &#39;sidebar&#39;, document.getElementById(&#39;ContactForm1&#39;), {&#39;contactFormMessageSendingMsg&#39;: &#39;Sending...&#39;, &#39;contactFormMessageSentMsg&#39;: &#39;Your message has been sent.&#39;, &#39;contactFormMessageNotSentMsg&#39;: &#39;Message could not be sent. Please try again later.&#39;, &#39;contactFormInvalidEmailMsg&#39;: &#39;A valid email address is required.&#39;, &#39;contactFormEmptyMessageMsg&#39;: &#39;Message field cannot be empty.&#39;, &#39;title&#39;: &#39;Contact Form&#39;, &#39;blogId&#39;: &#39;3298931441472502692&#39;, &#39;contactFormNameMsg&#39;: &#39;Name&#39;, &#39;contactFormEmailMsg&#39;: &#39;Email&#39;, &#39;contactFormMessageMsg&#39;: &#39;Message&#39;, &#39;contactFormSendMsg&#39;: &#39;Send&#39;, &#39;submitUrl&#39;: &#39;https://www.blogger.com/contact-form.do&#39;}, &#39;displayModeFull&#39;)); </script>
</b:if>

It will be like this.

fix contact us widget problem
fix the contact us widget problem


Now, your contact us form will work great, But you will still face a problem with the layout page of your template on Blogger.

Can you fix it?

Sorry, I didn't find any solution to fix these issues, but you can remove the attribute that you add for a moment when you want to change your layout settings or add any plugin to your page.

Conclusion

This was the best way to delete the widget.js file and explain how to solve the template layout page issue, follow us to be up to date on our site.
Murad Aden

I am a web developer, I love my sons, then my code, For development posts visit Dev To Give

Post a Comment

Previous Post Next Post
X Please support us and subscribe

Click Subscribe to close the window