↑ ↓ select, Enter open, Esc close

Find images without a loading attribute on a page

Adjust the values, the command updates live
user@server
curl -s https://example.com/ | tr '\n' ' ' | grep -oiE '<img[^>]*>' | grep -vi 'loading='

Prints every <img> element without a loading attribute. Images below the fold should carry loading="lazy" so they do not slow down the initial page render. No output means all images have a loading attribute.

Note: Do not lazy load the main image above the fold (the LCP element), otherwise LCP gets worse. To see which images do have loading="lazy", end the pipe with grep -i 'loading="lazy"' instead of grep -vi.

Also searched as

  • check lazy loading images
  • images without loading lazy
  • defer offscreen images pagespeed
  • are images lazy loaded

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.