Valid AMP document allows images to be loaded in a lightbox popup. You’ll find methods of deactivating this from AMP URLs below:
https://github.com/ampproject/amphtml/blob/master/spec/auto-lightbox.md
To control images within your content and stop them from being loaded individually you can keep watch of the below AMP plugin GitHub issue:
https://github.com/ampproject/amp-wp/issues/5122
Thread Starter
gahia
(@gahia)
Hello James, thanks for your reply.
Actually, I have no issues with lightbox or doubts about how it works.
I just want to know if it’s possible to avoid load the amp-lightbox script https://cdn.ampproject.org/v0/amp-lightbox-0.1.js.
As I’m not using lightbox at all, I would like to avoid loading it.
Unfortunately, I didn’t figure out how to… is it possible?
I understand. I’m unsure if it’s advisable to dequeue these component scripts.
@westonruter Can you advise?
@gahia Please share the URL of your AMP page that has this issue.
I assume that there actually is no <script> in the HTML and that the AMP runtime is loading this script.
Thread Starter
gahia
(@gahia)
No problem,
It’s online now here: https://www.gahia.com.ar
Thread Starter
gahia
(@gahia)
Please check the AMP validation checks: https://ibb.co/7Y40y9V
OK, I do see the script in the page:
<script src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js" async="" custom-element="amp-lightbox">
You are actually using amp-lightbox. You can see there is a <amp-lightbox> in the page for the mobile nav menu.
Thread Starter
gahia
(@gahia)
Oh! I see!
I didn’t even thought about an amp-lightbox tag and check just the images.
I will check how to fully remove the menu in header as it has no items… It’s a theme issue.
Sorry and thanks for your time!
No problem, happy to help. If you have a moment free be sure to leave your plugin review.