I built a service that auto-generates unique h1, alt text, and titles for images using OpenAI. This improved SEO, accessibility, reduced content cannibalization, and saved time for authors.I built a service that auto-generates unique h1, alt text, and titles for images using OpenAI. This improved SEO, accessibility, reduced content cannibalization, and saved time for authors.

Automation of ALT Text Generation for Images Using the OpenAI API

Hello, I’m a developer who has been building websites for some time. Not long ago, I took part in the development of a website that is still in its early stages. This is my test project for checking my own features (my first commercial project where I also worked on the server-side of the website; before that, I had experience creating a small REST API using Express.js, but here the server was built with Nest.js).

I won’t go into too many details now – instead, in this article I’ll write about the benefits I personally gained from this experience. (It might be within the next few days or weeks, I’ll either highlight a quote in this blog or leave a link in the comments here.)

\

Introduction to the Core of the Problem

One of the main and key problems is the lack of a unique h1 on image pages (many website SEO checking services report non-unique errors as a critical or medium-level issue), which is indexed by GoogleBot and participates in search results and Google Images.

The problem was the absence of alt in images, which are needed to improve SEO and adjust settings in Google Images, including to improve the accessibility of your website (see the European Directive on the accessibility of digital products and services, effective June 28, 2025):

\

  • problems when including an image;
  • for people with visual impairments, screen readers read the alt;
  • content cannibalization, for example, in the title and alternative images, leads to the use of titles to which the image belongs; in the web project, there were a large number of such titles.

\

An Example of This Problem Was Solved

The old version of the title and alternative text that was used looked like this, for example with this image – FlatOut 2 Screenshot 48. Below is the current version, which was generated with AI.

Example of a New Generated h1 for an Image Page

\ Example of a Generated alt for an Image

\ PS: The image description and caption were also generated with AI, but later we abandoned this idea since we cannot fully create the description – it turns out too long. (You can see an example here, and you can also compare this description – these were our first attempts based on the game description with the addition of the page. We eventually concluded that it was useless, but we decided to leave it in these test cases.)

\

Problem Solution

At the moment, I’ve written a test version – a small service that uses the OpenAI API and a function that provides prompts for AI templates of input data and configuration settings. (By the way, the new GPT-5 version no longer has the temperature parameter; previously, this parameter influenced creativity – see more details).

The next step in the development was a function in the image service, which is responsible for retrieving images that don’t yet have an alt or title. This function worked with a limit on the number of images to avoid overload. The p-limit library was used to manage parallel requests to the OpenAI API and speed up data generation.

So, we now have a ready function that can generate textual descriptions for images.

Currently, I use a cron function to trigger this process at intervals. In other words, I don’t generate alt text immediately at the time of image upload and don’t execute this operation in a separate queue (like Bull, BullMQ, and others).

\ At the moment, I am using the version gpt-4_1-mini-2025-04-14

OpenAI API Usage Metrics

Some Numbers:

  • 46.82s execution time for 5 requests to the OpenAI API with p-limit 1;
  • 19.71s - 23.12sExecution time for 5 requests using a p-limit of 3;

\

\ The price of this version is quite low: when generating alt text and titles for around 2,200 images, the cost was $5.5. I also tested more expensive versions but did not notice any significant improvement in the quality of generation or the accuracy of the image descriptions.

\

What We Achieved in the End

  • Unique page title;
  • Fully filled-in alt text;
  • Reduced cannibalization in the project;
  • Reduced workload for content authors (a concrete example: a website created in 6 languages, where authors cannot always afford to add alt/title to images in all languages - and in most cases, they don’t even want to do it in one language);
  • More attractive and enriched snippets in search results;
  • OpenGraph metadata, which can attract users from social networks.

In conclusion, I can say that the idea came naturally, although it is far from new.

Today, you can already find many ready-made solutions in search. If anyone needs help with such a custom implementation, here is my GitHub.

\


\

Sources:

  • European Directive on the accessibility of digital products and services;
  • Example website;
  • p-limit – a library for controlling concurrency of Promises;
  • Cheat sheet on the temperature[ and ]()top_p[ parameters in the ChatGPT API]();
  • GitHub (for contact).

\ \ \ \ \

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

ArtGis Finance Partners with MetaXR to Expand its DeFi Offerings in the Metaverse

ArtGis Finance Partners with MetaXR to Expand its DeFi Offerings in the Metaverse

By using this collaboration, ArtGis utilizes MetaXR’s infrastructure to widen access to its assets and enable its customers to interact with the metaverse.
Share
Blockchainreporter2025/09/18 00:07
Shiba Inu Price Forecast: Why This New Trending Meme Coin Is Being Dubbed The New PEPE After Record Presale

Shiba Inu Price Forecast: Why This New Trending Meme Coin Is Being Dubbed The New PEPE After Record Presale

While Shiba Inu (SHIB) continues to build its ecosystem and PEPE holds onto its viral roots, a new contender, Layer […] The post Shiba Inu Price Forecast: Why This New Trending Meme Coin Is Being Dubbed The New PEPE After Record Presale appeared first on Coindoo.
Share
Coindoo2025/09/18 01:13
Why The Green Bay Packers Must Take The Cleveland Browns Seriously — As Hard As That Might Be

Why The Green Bay Packers Must Take The Cleveland Browns Seriously — As Hard As That Might Be

The post Why The Green Bay Packers Must Take The Cleveland Browns Seriously — As Hard As That Might Be appeared on BitcoinEthereumNews.com. Jordan Love and the Green Bay Packers are off to a 2-0 start. Getty Images The Green Bay Packers are, once again, one of the NFL’s better teams. The Cleveland Browns are, once again, one of the league’s doormats. It’s why unbeaten Green Bay (2-0) is a 8-point favorite at winless Cleveland (0-2) Sunday according to betmgm.com. The money line is also Green Bay -500. Most expect this to be a Packers’ rout, and it very well could be. But Green Bay knows taking anyone in this league for granted can prove costly. “I think if you look at their roster, the paper, who they have on that team, what they can do, they got a lot of talent and things can turn around quickly for them,” Packers safety Xavier McKinney said. “We just got to kind of keep that in mind and know we not just walking into something and they just going to lay down. That’s not what they going to do.” The Browns certainly haven’t laid down on defense. Far from. Cleveland is allowing an NFL-best 191.5 yards per game. The Browns gave up 141 yards to Cincinnati in Week 1, including just seven in the second half, but still lost, 17-16. Cleveland has given up an NFL-best 45.5 rushing yards per game and just 2.1 rushing yards per attempt. “The biggest thing is our defensive line is much, much improved over last year and I think we’ve got back to our personality,” defensive coordinator Jim Schwartz said recently. “When we play our best, our D-line leads us there as our engine.” The Browns rank third in the league in passing defense, allowing just 146.0 yards per game. Cleveland has also gone 30 straight games without allowing a 300-yard passer, the longest active streak in the NFL.…
Share
BitcoinEthereumNews2025/09/18 00:41