AI Built My WordPress Theme, Then It Broke My Performance

I am an SEO specialist. I enjoy testing new tools.

I recently asked an AI to build a custom WordPress theme from scratch. I described the layout and provided the content.

At first, the results looked great. The site hit a 100/100 score on Lighthouse for both mobile and desktop. The code looked clean.

Then I made small edits. The mobile score dropped from 100 to 89. Desktop stayed at 100.

The problem was a single image attribute. This mistake shows why you must review AI code.

Fast desktop connections hide bottlenecks. Mobile devices expose them. The score drop meant an asset was using bandwidth it did not need.

The mobile report pointed to an image in the Largest Contentful Paint (LCP) path. It was a screenshot from an old game.

On a desktop, this image is fine. But on mobile, a large data table fills the screen. This table pushes the image far down the page. The image is not visible when the page loads.

The AI wrote this code: Aladdin

The code is valid. The logic is wrong. The AI assumed the first image in the code is the hero image. It lacks visual awareness. It forced mobile browsers to download a hidden image immediately.

I changed the code to: Aladdin

The score did not change at first. I thought I was losing my mind. I spent twenty minutes looking for bugs. Then I realized my server cache was still serving the old code.

I cleared the cache. The mobile score returned to 100.

The AI did not fail. It made a logical guess based on code order. But it cannot see the layout. It does not understand how a table changes the viewport.

If you use AI to build components, follow these steps:

  • Audit fetchpriority and loading="lazy". Check them against the actual layout. Do not trust the order of the code.
  • Look for images hidden under tables or sliders.
  • Isolate your testing. Always purge your cache before you test. Do not audit stale code.

AI code is clean enough to use. You still need a human to check if the code matches the reality of the page.

Source: https://dev.to/serdiniakos/an-ai-built-my-wordpress-theme-then-i-found-the-performance-bugs-it-left-behind-59hg

Optional learning community: https://t.me/GyaanSetuAi