<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: JoanE</title>
    <description>The latest articles on DEV Community by JoanE (@ejoan).</description>
    <link>https://dev.to/ejoan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3413867%2Fd965c939-af97-4f6b-92c6-402978cbc7e8.png</url>
      <title>DEV Community: JoanE</title>
      <link>https://dev.to/ejoan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ejoan"/>
    <language>en</language>
    <item>
      <title>Lazy Load Images in WordPress Without a Plugin</title>
      <dc:creator>JoanE</dc:creator>
      <pubDate>Tue, 05 Aug 2025 19:15:28 +0000</pubDate>
      <link>https://dev.to/ejoan/lazy-load-images-in-wordpress-without-a-plugin-304h</link>
      <guid>https://dev.to/ejoan/lazy-load-images-in-wordpress-without-a-plugin-304h</guid>
      <description>&lt;p&gt;On a recent project, I needed to improve a client’s page speed by lazy loading images—but they didn’t want more plugins added. Luckily, WordPress makes this simple with just a small code tweak.&lt;/p&gt;

&lt;p&gt;Here’s what I did.&lt;/p&gt;

&lt;p&gt;I added a few lines of PHP to the theme’s functions.php file that automatically inserts the loading="lazy" attribute into every image inside post content. It’s a neat way to get lazy loading done without plugin overhead.&lt;br&gt;
I used this snippnet:&lt;/p&gt;

&lt;p&gt;function add_lazy_loading_to_images( $content ) {&lt;br&gt;
   $content = preg_replace('/&amp;lt;img(.*?)src=/i', '&amp;lt;img loading="lazy"$1src=', $content);&lt;br&gt;
    return $content;&lt;br&gt;
}&lt;br&gt;
add_filter('the_content', 'add_lazy_loading_to_images');&lt;/p&gt;

&lt;p&gt;Paste that into your theme’s functions.php, save it, and you're done. Now images won’t load until they’re actually visible in the browser viewport. Simple as that.&lt;/p&gt;

&lt;p&gt;At Blueinc Technologies, we prefer these kinds of quick wins to keep sites fast and avoid plugin bloat.&lt;/p&gt;

&lt;p&gt;If you’re working on WordPress performance tweaks like this and want to brainstorm ideas, feel free to reach out via our website &lt;a href="https://blueinctech.com/" rel="noopener noreferrer"&gt;Blueinc Technologies&lt;/a&gt;. Always happy to collaborate on dev-friendly solutions.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>website</category>
      <category>webdev</category>
      <category>images</category>
    </item>
  </channel>
</rss>
