Reduce widget size

Widget size/unused java script is slowing down page loading time significantly.

1 Like

Folks, our former Wishlist portal, where our users shared their requests and suggestions, was transferred to this forum. You’re most welcome to vote, add new ideas, and leave your comments here — we surely will consider them all! :star_struck:

Original Votes: 4

Hello folks,

I’m happy to tell about the lazy loading beta version for embedded widgets, that might be a solution here!

It doesn’t work as a built-in option yet due to a couple of unresolved matters, but you can adjust your widget manually in order to make it work :slight_smile:

To turn it on, please add the “data-elfsight-app-lazy” attribute to a

element in your installation code.

For example, here’s how the code looks like initially:

<script src="" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX"></div>

And here’s how it should look like with the attribute added:

<script src="" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX" data-elfsight-app-lazy></div>

Please keep in mind that it will work only for widgets which are not in the initial viewport (e.g. users have to scroll down at least for a little bit before they reach the widget).

Please let me know if it worked for you!


The code before and after is not showing for me. Could you please update it, would love to lazy load it on my website!

Thanks :slight_smile:

1 Like

Hi @Niels, welcome to the community forum! :heart_eyes:

My apologies for this, it seems the codes got distorted when transferring from the previous portal—but all is good now :slight_smile:

Could you please try them and let me know if it worked?

Hi Helga,

is the widget supposed to be smaller in size now? From everything I can tell in Page Speed Insights, it’s not. But maybe I’m doing something wrong/am missing something. I did apply the new code.


I am also having problems where sites like Lighthouse, GTMetrix and Google report that the payload of Elfsight is “enormous”. Anything I can do about this? Looks like it messes up my site speed quite significantly.

Hello @Niels!

This is Maksim stepping in for Helga!

I am deeply sorry for any inconvenience caused!

Unfortunately, the Reviews script size is quite big. Please accept my sincere apologies!

We are working on it and will try to improve the situation as much as possible!

I’ve forwarded your request to our devs and they will try to reduce its size. I’ll keep you updated :wink:

Thanks - what Niels is saying is exactly why I’d made the post originally, because it slows down performance and thus affects user experience and Google rankings.

Hello @Jaytee!

Thank you for your kind feedback :slightly_smiling_face: I totally understand your point.

We’ll try all our best to improve it and make our customers a bit happier!


1 Like

Hi @Max ,

Just did a quick test and the script is really impacting performance a lot. Do you perhaps have a timeline on when speed could be improved? Due to the big impact I think in the meantime we will stop using it until it’s fixed.

Screenshots of our test attached.

I would suggest to just load the latest 5 reviews and have a link to the google reviews page on Google if users want to see more. It loads quite a lot of reviews now, but no idea if that would speed up performance a lot.

Maybe an iframe that is lazy loaded would help as well? Not sure tho.

Seems that the main thing the widget is effecting is the Total Blocking time.
Also 1,369 ms total Javascript execution time, which is a lot.

I’d be happy to test things out if you have beta versions ready. Feel free to reach out.


Hi @Neils,

Just to be on the same page could you please tell me whether you’re using the lazy-loading or not?
Anyway it would be so kind of you if you can share the page URL for me to check it out.
I’m sure we can make it better.



Yes I am using the lazy-loading addition. It’s not on my homepage anymore, the performance simply is too bad. I could embed it on our testing environment. Would that help?

I believe it would. Let’s give it a try.

I don’t want a referring url to our testing environment so it’s: sandbox . without the space bars :slight_smile:


Haven’t tested this, but what about something like this?

var scrollLoader = function() {
// script here
    window.removeEventListener('scroll', scrollLoader);

window.addEventListener('scroll', scrollLoader);

Would that work u think?

Thank you. It seems we got an interesting case here. I should admit that the lazy-loading feature is quite “young” if we can say so. We thoughtfully tested it in standard environments. A bunch of our customers have successfully configured it on their websites. However, it looks like we missed something and your case gonna help us revealing what. Please could you keep the widget on the sandbox page for some time and let me investigate and think a bit?

1 Like

will do!

Hi @Niels,

Just a quick update from me. I’ve found that the lazy-loading feature is not working properly when a widget is being added in a late document mutation - which is happening on your site when it’s opened on a mobile device. By the way, the lazy-loading works on a desktop as expected. I’m going to deploy the fix to our platform early next week once the change gets approved by my peers. I’ll keep you in the loop. Thanks for the sample, your help is crucial :metal: