Logo Cinquin Andy Signature

How to use my Strapi plugin for SEO optimization of images

Développeur Freelance - Logo

The sites and the associated resources.

How to use my Strapi plugin for SEO optimization of images

Posted on April 11, 2024 -  by Andy Cinquin

SEOStrapi pluginImage optimizationReferencingOnline visibilitySearch enginesOptimized contentAutomatic generation of alternative textsAuto alt, caption, title on image

How to use my Strapi plugin, ALT, Title, Caption auto-generation on images from a Strapi API!

Hello everyone, in this article we're going to take a look at the plugin I've developed to automate image naming, the addition of alternative text and captions.
It's a Strapi plugin I developed myself after needing to optimize the SEO of my portfolio. Indeed, image alt text is important for SEO purposes. It was therefore necessary to have, for accessibility and SEO purposes, consistent names and alt tags for each of my images.
Problem: I had nearly a thousand images uploaded to my portfolio...
How to solve the problem? Adapt the scripts I'd made for the Obsidian plugin I'd developed over the same period of time.
So, let's see how to install and use my library!
We install the :
yarn add strapi-plugin-auto-alt-caption-title-on-images-ai-enhanced
Then activate the plugin(config/plugin.js), adding the following lines to the plugin list:
module.exports = { // ... 'auto-alt-caption-title-on-images-ai-enhanced': { enabled: true, }, // ... }
We add our OpenAI key to the environment variables: (.env)
OPENAI_API_KEY=your-api-key
Rebuild our app & restart it
npm run build npm run develop or npm run build npm run start
  • Then access the plugin in Strapi's administration panel by navigating to the "Auto Alt Caption Title on Images" section.
Screenshot of the Strapi Dashboard with various sections like Strapi Cloud, Documentation, Code examples, Tutorials, and Blog for users to explore
  • The plugin will display a list of images in your Strapi Media Library that have no alt text, caption or name.
Computer screen showing a user interface for a plugin to automatically generate alt text, captions, and titles for images using AI. Multiple image thumbnails are displayed, with a 'Process all images' button for batch processing.
  • To process a single image, click on the desired image. The plugin will initiate AI-driven image analysis and generate the alternative text, caption and name for that specific image.
Screenshot of a web page for a plugin that automatically processes alt text, captions, and titles on images using AI.
  • To process all images at once, click on the "Process All Images" button. The plugin will start analyzing and generating descriptions for all images in the list.
Computer interface displaying thumbnails of 26 images with filenames starting with 'pres-', a button to process all images for alt text and metadata
  • While images are being processed, you can monitor progress via the progress bar and status messages.
Software interface for a plugin using AI to automatically process alternative text, captions, and titles for images.
  • If necessary, you can cancel image processing by clicking on the "Cancel" button. This will stop processing the remaining images, but will not revoke any changes made to images already processed.
Computer interface showing an image processing plugin in progress with AI generating content for images
  • Once image processing is complete, the generated alternative text, caption and name will be automatically saved for each image in the Strapi Media Library.
Close-up of an open MacBook Pro displaying a French menu in a digital asset management interface
And that's it! Now you can stop worrying about renaming all your images! Fantastic, isn't it?



Thank you for your visit, feel free to contact me for any information, quote or collaboration proposal. I will be happy to answer you as soon as possible.
Did you like this article? Feel free to share it!

DEVELOP YOUR PROJECTS TOGETHER

An idea, a project? I'm here to answer your questions and help you.
I'd be delighted to discuss your project with you!