ChatGPT makes a working custom WordPress plugin

OpenAI ChatGPT

In December, ChatGPT surpassed the 1 million user mark, and Twitter is full of creative questions and uses for the AI-powered chatbot. The language model, created by OpenAI, is powered by GPT-3.5, a series of models trained on text and code from before Q4 2021. The model has a conversational format that enables ChatGPT to “answer follow-up questions, admit mistakes, challenge incorrect premises, and reject inappropriate requests.”

While some are predicting the end of search engines and sounding the death knell for human-generated writing, others are fascinated by the potential of AI systems to fundamentally change the creative process. WordPress developer Johnathon Williams brought this closer when he asked ChatGPT to create a WordPress plugin.

Creating a plugin usually requires a certain level of technical skill. Williams showed that, with a little expert guidance, ChatGPT can drastically reduce the time needed to extend WordPress.

Williams installed the plugin and found that it worked on the first try. Although he did not save the prompt from this first attempt, he published a gist of the generated code on GitHub.

On a second attempt to create another plugin, he used the following prompt:

Create a custom WordPress plugin called “Big Daddy Media” that deletes images older than one year from the media library. OOP. Custom admin screen. one button delete. log the full URL of all deleted media files.

Williams said that although he had mixed results with his prompts, he got the best results by asking ChatGPT to generate entire functions instead of specific filters or actions.

Naturally, we were also curious and gave a simple command to create a WordPress dashboard plugin with the best-selling products: Create a custom WordPress plugin called “Top orders” that displays WooCommerce’s best-selling products in the WordPress dashboard. With the result below:

Theoretically, with additional training on plugin best practices and common architecture, ChatGPT could be used by people at all levels to extend WordPress in creative ways.

“Very soon, describing the WordPress plugin you need to ChatGPT will lead to a new plugin being generated faster than searching for an existing plugin in the plugin directory,” Williams said. “This won’t apply to every type of plugin, of course. But for relatively simple plugins that perform established tricks … however, very soon should probably be read as ‘now’.”

P.S. This blog post was written using ChatGPT :)

Request web hosting

Request your hosting account below!

Request a benchmark now

Do you feel like your website could be faster? Let us run a benchmark. We guarantee that your website will run faster on our hosting!