ChatGPT: Have a WordPress plugin created – this is how it works

by Corinna

While you used to need a programmer for this, today you can develop a WordPress plugin with ChatGPT. This way you can add new functions to the CMS individually.

Writing a WordPress plugin with ChatGPT: This is how it works

Before you can write a WordPress plugin with ChatGPT, you need to know how one works in the first place.

  • A WordPress theme is written in the server language PHP. You can easily generate the PHP code with ChatGTP.
  • To turn the finished code into a theme, you must first copy it into a text file and save it with the file extension “.php”.
  • Now move the created php file to a new folder and name it the same as the file.
  • Compress the folder. In WordPress, navigate to “Install Plugins” via the sidebar.
  • Click on “Upload Plugin” at the top and install the plugin you created.

WritingPHP with ChatGPT: How to build the prompt

To get a response from ChatGPT, you must first ask a question. This is called a prompt.

  • Phrase your prompt as specifically as possible. Specify that a WordPress plugin should be written in PHP 8: “Write a PHP compatible WordPress plugin that… “
  • Describe exactly what you want your plugin to do and how it works. Be sure to include any settings pages that are needed.
  • If the generated result still does not meet your expectations, ask for a correction. ChatGPT recognises the context and changes the previously delivered code so that it performs the new task.
  • Beware that ChatGPT can also make mistakes. Especially in safety-critical areas, you should therefore test the plugin carefully before productive use and have it checked by experienced programmers.

Related Articles

Leave a Comment