How I Automated SEO for WordPress Media Using OpenAI
Sometimes, you just need to make life easier. A friend of mine was dealing with a lot of images on their WordPress site, and manually adding SEO details to each one was becoming a real headache. That’s when I thought, “Why not automate this?” And so, I ended up building a WordPress plugin that uses OpenAI to handle the heavy lifting.
Let me take you through how it all came together, from the initial idea to the finished plugin, which I’m now sharing on GitHub as part of my ongoing projects with Tropical Devs.
The Problem: Too Many Images, Not Enough Time
So here’s the deal — my friend’s WordPress site was growing, and so was the media library. Adding SEO-friendly titles, descriptions, and alt text for each image manually? Not fun. They needed something that could streamline this process and make sure every image was optimized without spending hours on it.
Getting Started with the Right Tools
Before diving into coding, I wanted to make sure I had a solid foundation. That’s where WPPB came in handy. It’s a boilerplate generator for WordPress plugins, and it saved me a ton of time by giving me a clean structure to start with.

Using OpenAI’s API to Do the Heavy Lifting
The real magic of the plugin comes from OpenAI’s API. This API is incredibly powerful for generating human-like text, so it was a perfect fit for creating SEO-friendly content. By feeding it some details about the image, the API can spit out optimized titles, descriptions, and alt text.
One cool feature I added is the option to choose between different OpenAI models: GPT-4o and GPT-4o-mini. This gives users the flexibility to prioritize either precision or cost, depending on what they need.


Building the Plugin: Step by Step
Once I had the boilerplate and API integration ready, it was time to build. Here’s how it all came together:
- Automatic SEO Generation: The plugin automates the creation of titles, descriptions, and alt text, so you don’t have to.
- Batch Processing: Need to update multiple images? No problem. The plugin lets you select multiple items in the media library and generate SEO for all of them at once.
- Customizable Options: Choose the OpenAI model that fits your needs, whether you’re looking for the best accuracy or the most cost-effective option.

Sharing the Plugin
After seeing how well the plugin worked, I realized it could help a lot more people. So, I decided to make it public on GitHub. This is also the first project under Tropical Devs, a new company I’m launching with some colleagues. We’re all about helping organizations with cloud solutions, development, QA, project management, frontend development, and more.
You can check out the plugin here on GitHub.
Wrapping Up
What started as a small project to help a friend has turned into something much bigger. Not only did I get to create something useful, but it also helped kickstart Tropical Devs. If you’re dealing with a growing media library in WordPress and need some SEO automation, give the plugin a try. And if you find it helpful, don’t forget to star the repo and leave your feedback!
Thanks for reading! Feel free to drop any comments or questions below.