{"id":13482,"date":"2024-12-04T10:07:20","date_gmt":"2024-12-04T10:07:20","guid":{"rendered":"https:\/\/www.icdsoft.com\/blog\/?p=13482"},"modified":"2024-12-04T10:07:22","modified_gmt":"2024-12-04T10:07:22","slug":"how-to-build-a-wordpress-ai-tool","status":"publish","type":"post","link":"https:\/\/www.icdsoft.com\/blog\/how-to-build-a-wordpress-ai-tool\/","title":{"rendered":"How To Build a WordPress AI Tool In 6 Easy Steps (Working Example)"},"content":{"rendered":"\n<p>Some of the more popular use cases of WordPress AI tools are the integrations of chatbots, generating content and images, and optimizing SEO. Given the vastness of the WordPress ecosystem and its popularity among users and developers, adding such AI-powered functionality to a WordPress website can be quite straightforward. Usually, all you need to do is install a plugin that will do everything for you. But what if the plugin or functionality you are looking for is not directly available? Today, we will take things a step further, by showing you how to actually build a fully working AI-driven tool for your WordPress website, step by step.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-an-ai-tool-for-word-press-and-why-would-you-need-one\">What Is an AI Tool for WordPress, and Why Would You Need One?<\/a><\/li><li><a href=\"#creating-an-ai-powered-domain-name-generator\">Creating an AI-powered Domain Name Generator<\/a><\/li><li><a href=\"#quick-project-overview\">Quick Project Overview<\/a><\/li><li><a href=\"#1-setting-up-a-staging-environment\">1. Setting Up a Staging Environment<\/a><\/li><li><a href=\"#2-configuring-access-to-the-ai-api\">2. Configuring Access to the AI API<\/a><ul><li><a href=\"#1-create-an-open-ai-account\">1. Create an OpenAI Account<\/a><\/li><li><a href=\"#2-access-the-api-key-section\">2. Access the API Key Section<\/a><\/li><li><a href=\"#3-generate-an-api-key\">3. Generate an API Key<\/a><\/li><\/ul><\/li><li><a href=\"#3-configuring-access-to-the-icd-soft-api\">3. Configuring Access to the ICDSoft API<\/a><\/li><li><a href=\"#4-installing-the-icd-soft-reseller-store-plugin-for-word-press\">4. Installing the ICDSoft Reseller Store Plugin for WordPress<\/a><\/li><li><a href=\"#4-the-domain-name-generator-script-for-word-press\">5. The Domain Name Generator Script for WordPress<\/a><\/li><li><a href=\"#5-integrating-our-ai-tool-with-word-press\">6. Integrating Our AI Tool with WordPress<\/a><ul><li><a href=\"#5-1-setting-up-a-word-press-child-theme\">6.1 Setting Up a WordPress Child Theme<\/a><\/li><\/ul><\/li><li><a href=\"#6-2-activating-our-word-press-child-theme\">6.2 Activating our WordPress Child Theme<\/a><\/li><li><a href=\"#5-2-adding-the-domain-name-generator-to-our-word-press-page\">6.3 Adding the Domain Name Generator to Our WordPress Page<\/a><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-an-ai-tool-for-word-press-and-why-would-you-need-one\">What Is an AI Tool for WordPress, and Why Would You Need One?<\/h2>\n\n\n\n<p>We will define a WordPress AI tool as an added functionality to your website that uses Artificial Intelligence to generate its results. For example, you could add a title generator on your website that creates search engine-optimized titles for YouTube videos or blog posts, based on certain keywords entered by your website visitors. Or you could add a children's storyteller, a spellchecker, or a book summary generator. Having such a tool freely available on your site could help generate traffic.<\/p>\n\n\n\n<p>Of course, things can get a lot more complex as AI can be used to perform various difficult tasks. For example, you could create a chatbot and have it use your knowledge base to answer the website visitors' questions. Or you could build an AI-powered product recommendation tool for your WordPress store that will suggest products and services based on user behavior, boosting sales or engagement. For example, Amazon recently introduced <a href=\"https:\/\/www.aboutamazon.com\/news\/retail\/amazon-rufus\" target=\"_blank\" rel=\"noreferrer noopener\">Rufus<\/a>, which is a <em>\"generative AI-powered conversational shopping assistant designed to help customers save time and make more informed purchase decisions\"<\/em>.<\/p>\n\n\n\n<p>AI could also be used to provide an intelligent search functionality on your site with predictive typing and voice search. Another possible use case is in the field of fraud detection and security, where you could integrate AI to protect your site against spam, identify fake signups, and suspicious transactions.<\/p>\n\n\n\n<p>Bottom line is that AI boasts a wealth of possible ways in which it could add value to your website. The purpose of this blog post is to show you the basic principles of building an AI tool in the context of WordPress with a real-life, fully working example. Once you have that foundation, you could go on to create your own integrations regardless of the platform. You are not limited to just WordPress, as you can easily translate that process to any other CMS out there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-an-ai-powered-domain-name-generator\">Creating an AI-powered Domain Name Generator<\/h2>\n\n\n\n<p>We will use AI to extend the functionality of our reseller hosting website <a href=\"https:\/\/hectohost.com\" target=\"_blank\" rel=\"noopener\">HectoHost.com <\/a>to add a domain name generator. You've probably been there yourself. You are looking to start a new website, but you can't think of a good domain name for it. Our domain name generator will ask the visitor to enter a description of their business or project, and then we will use ChatGPT to come up with suitable domain names. You can test it yourself at the <a href=\"https:\/\/www.hectohost.com\/domains\/\" target=\"_blank\" rel=\"noreferrer noopener\">Domains<\/a> page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"474\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-1024x474.webp\" alt=\"AI-powered domain search tool for finding the perfect domain name, featuring a magnifying glass and globe icon.\" class=\"wp-image-13643 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-1024x474.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-300x139.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-1536x712.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/474;\" \/><\/a><\/figure>\n\n\n\n<p>However, if you've done this yourself, you've probably found that, although quite on point in most cases, ChatGPT will often come up with domains that are already taken. That's why we will use the ICDSoft freely available and <a href=\"https:\/\/accounts.icdsoft.com\/docs\" target=\"_blank\" rel=\"noopener\">documented API<\/a> to check which of the AI-generated domains are available and will only display those to our visitors with a direct option to order. Not only that, but we will also show you how to integrate the tool on any WordPress post or page while utilizing your existing theme style.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-results-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"481\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-results-1024x481.webp\" alt=\"Website displaying available domain names related to web hosting with search input and order options.\" class=\"wp-image-13642 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-results-1024x481.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-results-300x141.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Domain-Name-Generator-\u2013-Hecto-Host-results-1536x721.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/481;\" \/><\/a><\/figure>\n\n\n\n<p>We will use AI to do the heavy lifting for us in terms of writing the code for our tool, so you can follow those principles and create your own WordPress AI tool without any programming skills.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"quick-project-overview\">Quick Project Overview<\/h2>\n\n\n\n<p>The first step when developing a WordPress AI tool is to have a clear idea of how it would operate. Here is a quick overview of how our domain name generator would work:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The user enters a description of their idea or business\/project. <\/li>\n\n\n\n<li>The information entered by the user is sent to ChatGPT to generate a list of domains that best match the provided description.<\/li>\n\n\n\n<li>Each of the domains generated by ChatGPT is sent to the ICDSoft API to check its availability. <\/li>\n\n\n\n<li>Only the available domains are sent back to the user as results with an option to directly purchase each domain using the custom prices configured in the user's ICDSoft reseller hosting store.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4.png\"><img decoding=\"async\" width=\"1024\" height=\"864\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4-1024x864.png\" alt=\"WordPress AI flowchart\" class=\"wp-image-13630 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4-1024x864.png 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4-300x253.png 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4-1536x1295.png 1536w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Flowcharts-4-554x466.png 554w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/864;\" \/><\/a><\/figure>\n\n\n\n<p>You can learn more about setting up an online web hosting business using the <a href=\"https:\/\/www.icdsoft.com\/en\/reseller\" target=\"_blank\" rel=\"noreferrer noopener\">ICDSoft reseller partner program<\/a> in our <a href=\"https:\/\/www.icdsoft.com\/blog\/start-your-own-hosting-company\/\" target=\"_blank\" rel=\"noreferrer noopener\">blog<\/a> and on our <a href=\"https:\/\/www.youtube.com\/watch?v=9M4C6eM_Wjk\" target=\"_blank\" rel=\"noreferrer noopener\">YouTube<\/a> channel.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"epyt-video-wrapper\"><iframe  id=\"_ytid_55153\"  width=\"770\" height=\"433\"  data-origwidth=\"770\" data-origheight=\"433\" src=\"https:\/\/www.youtube.com\/embed\/9M4C6eM_Wjk?enablejsapi=1&autoplay=0&cc_load_policy=0&cc_lang_pref=&iv_load_policy=1&loop=0&rel=1&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=1&disablekb=0&\" class=\"__youtube_prefs__  epyt-is-override  no-lazyload\" title=\"YouTube player\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<div class=\"wp-block-advgb-infobox advgb-infobox-wrapper has-text-align-center advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482\"><div class=\"advgb-infobox-wrap\"><div class=\"advgb-infobox-icon-container\"><div class=\"advgb-infobox-icon-inner-container\"><i class=\"material-icons-outlined\">android<\/i><\/div><\/div><div class=\"advgb-infobox-textcontent\"><h3 class=\"advgb-infobox-title\">Important<\/h3><p class=\"advgb-infobox-text\">While the ICDSoft API is absolutely free to use and only requires a <a href=\"https:\/\/accounts.icdsoft.com\/register\" data-type=\"link\" data-id=\"https:\/\/accounts.icdsoft.com\/register\" target=\"_blank\" rel=\"noopener\">free account<\/a>, sending API requests to ChatGPT requires upgrading to one of their paid plans or adding a credit card to use their \"Pay as you go\" option.<\/p><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-setting-up-a-staging-environment\">1. Setting Up a Staging Environment<\/h2>\n\n\n\n<p>Whenever you are looking to add a new functionality to your WordPress website, modify an existing one, or simply make a design change, it's always best to do it in a testing environment first. This way, your live website will remain intact and fully operational, while you are safely \"breaking stuff\" at the staging instance. Once you are fully ready and have ensured that everything works as expected, you can then transfer your changes over to the live site.<\/p>\n\n\n\n<p>Back in the day, this entire process used to involve a lot of manual work, as you would have to copy the entire live WordPress website to another location, set up a new database and update the configuration file, apply your changes, and then recreate them at the live website or move the staging instance in place of the live one. Fortunately for our customers at ICDSoft, those days are long gone.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-1024x498.webp\" alt=\"Web hosting dashboard showing site URL settings, staging options, resources, and backup details for website management.\" class=\"wp-image-13521 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><figcaption class=\"wp-element-caption\">The WordPress Manager included with all hosting plans at ICDSoft allows you to easily create multiple staging instances of your live WordPress website, so you can test safely and later transfer the changes via the \"Set as live\" option.<\/figcaption><\/figure>\n\n\n\n<p>If you are hosted with us, you can use our freely available <strong>WordPress Manager<\/strong> included with all of our <a href=\"https:\/\/www.icdsoft.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">hosting plans<\/a>. It allows you to back up your entire WordPress installation and even set up a staging instance with just a single click. Once you are done working on the staging site, the WordPress Manager allows you to transfer all your changes to the live site using the \"Set as live\" option.<\/p>\n\n\n\n<div class=\"wp-block-advgb-infobox advgb-infobox-wrapper has-text-align-center advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb\"><div class=\"advgb-infobox-wrap\"><div class=\"advgb-infobox-icon-container\"><div class=\"advgb-infobox-icon-inner-container\"><i class=\"material-icons-outlined\">playlist_add<\/i><\/div><\/div><div class=\"advgb-infobox-textcontent\"><h3 class=\"advgb-infobox-title\">Use a Separate Subdomain<\/h3><p class=\"advgb-infobox-text\">When setting up a WordPress staging instance, it's always best to use a separate subdomain to avoid possible interference with the operation of the live website. The website in our working example <a href=\"https:\/\/www.hectohost.com\" target=\"_blank\" rel=\"noopener\">www.hectohost.com<\/a> runs at the <strong>www<\/strong> subdomain, so we will create a new one called \"<strong>staging<\/strong>\" and set up our staging instance there. <\/p><\/div><\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"200\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/httpsstaging.hectohost.com_-1.webp\" alt=\"Search bar with staging.hectohost.com URL in red and blue against a white background.\" class=\"wp-image-13516 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/httpsstaging.hectohost.com_-1.webp 800w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/httpsstaging.hectohost.com_-1-300x75.webp 300w\" data-sizes=\"(max-width: 800px) 100vw, 800px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 800px; --smush-placeholder-aspect-ratio: 800\/200;\" \/><\/figure>\n\n\n\n<p>Once you've created a new subdomain for your testing environment, you can use the WordPress Manager in the Control Panel to create a staging instance of your live website there. You can watch the video below for a quick step-by-step walkthrough.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"epyt-video-wrapper\"><iframe  id=\"_ytid_87022\"  width=\"770\" height=\"433\"  data-origwidth=\"770\" data-origheight=\"433\" src=\"https:\/\/www.youtube.com\/embed\/w6ESxfcApfA?enablejsapi=1&autoplay=0&cc_load_policy=0&cc_lang_pref=&iv_load_policy=1&loop=0&rel=1&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=1&disablekb=0&\" class=\"__youtube_prefs__  epyt-is-override  no-lazyload\" title=\"YouTube player\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-configuring-access-to-the-ai-api\">2. Configuring Access to the AI API<\/h2>\n\n\n\n<p>As per our definition of a WordPress AI tool, we will use Artificial Intelligence to generate results, so we would need a way of feeding it data and then serving the output to our users. In the world of web development, this is done through the use of API calls. API calls are like communication channels between different services. For example, a weather app makes API calls to a weather station to obtain information about the current temperature and wind direction.<\/p>\n\n\n\n<p>So our WordPress website will make API calls to an AI chatbot. There are a number of publicly available chatbots you could use. All of the tech giants have released their own language models, and most of them provide API access.<\/p>\n\n\n\n<p><a href=\"https:\/\/chatgpt.com\" target=\"_blank\" rel=\"noopener\">ChatGPT<\/a> is perhaps the most powerful and certainly most popular conversational AI available to the public. It can answer complex questions, write content or even programming code, brainstorm ideas and perform various tasks, such as code debugging or language translations.<\/p>\n\n\n\n<p>Google's <a href=\"https:\/\/gemini.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gemini<\/a> is another quite capable AI chatbot similar to ChatGPT. While ChatGPT is generally better for text-based tasks and doing research, Gemini can be used to create images even with its free plan. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Gemini-11-24-2024-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Gemini-11-24-2024-1024x498.webp\" alt=\"Red fox running swiftly across snowy landscape with blurred forest background.\" class=\"wp-image-13549 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Gemini-11-24-2024-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Gemini-11-24-2024-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Gemini-11-24-2024-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><\/figure>\n\n\n\n<p>Both Gemini and ChatGPT's web interfaces are free for general use. You just need to sign up, and you can enter your questions or prompts to get the AI's response. However, access to the API usually requires a subscription.<\/p>\n\n\n\n<p>In our case, we will use ChatGPT, but you can get similar results with Gemini. It's up to you to decide which service is best for you in terms of quality of results and cost. The Gemini API has a free tier that allows you to use the API with lower rate limits for testing purposes. For commercial use, you will probably need to scale things up a bit and move to one of their paid plans.<\/p>\n\n\n\n<p>As of now, OpenAI does not offer a completely free tier for API access to ChatGPT or other models. However, they provide <strong>trial credits<\/strong> for new users.<\/p>\n\n\n\n<p>The good news is that both services provide a \"pay-as-you-go\" type of plan, so you won't be charged a fixed rate; you will only pay as much as you use. The charges depend on the number of tokens (words\/characters) you process. This is a great entry point for developing a WordPress AI tool as you can monitor your usage in real time and see if it makes sense for you financially. Obviously, if you release a tool that's free to use like our domain name generator, you want to make sure it does not go overboard and incur significant costs. You can configure <strong>hard limits<\/strong> and <strong>soft limits<\/strong> to prevent unexpected charges.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Usage-Cost-OpenAI-API-11-23-2024.png\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Usage-Cost-OpenAI-API-11-23-2024-1024x498.png\" alt=\"Dashboard showing monthly spend, project cost breakdown, and credit grants with expiry dates and balance limits.\" class=\"wp-image-13547 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Usage-Cost-OpenAI-API-11-23-2024-1024x498.png 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Usage-Cost-OpenAI-API-11-23-2024-300x146.png 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Usage-Cost-OpenAI-API-11-23-2024-1536x746.png 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><figcaption class=\"wp-element-caption\">This is a screenshot of our billing page when using ChatGPT's API for testing and developing our domain name generator tool. Careful monitoring of API usage is essential to control expenses. At ChatGPT, this information is available at the <a href=\"https:\/\/platform.openai.com\/account\/usage\" target=\"_blank\" rel=\"noopener\">Usage<\/a> menu.<\/figcaption><\/figure>\n\n\n\n<p>In terms of pricing with ChatGPT, access to the GPT-3.5 language model via API is significantly cheaper than GPT-4, so that's the one we will use, and the results are still quite good.<\/p>\n\n\n\n<p>Getting an OpenAI API key is a straightforward process. Here are the steps:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-create-an-open-ai-account\">1. <strong>Create an OpenAI Account<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to <a href=\"https:\/\/platform.openai.com\/signup\/\" rel=\"nofollow noopener\" target=\"_blank\">OpenAI's website<\/a>.<\/li>\n\n\n\n<li>Sign up using your email address, or log in if you already have an account.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-access-the-api-key-section\">2. <strong>Access the API Key Section<\/strong><\/h3>\n\n\n\n<p>Once logged in to your OpenAI account, navigate to the <strong><a href=\"https:\/\/platform.openai.com\/settings\/organization\/api-keys\" target=\"_blank\" rel=\"noreferrer noopener\">API Keys<\/a><\/strong> section.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-generate-an-api-key\">3. <strong>Generate an API Key<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/API-keys-OpenAI-API-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/API-keys-OpenAI-API-1024x498.webp\" alt=\"Popup window for creating a new secret API key with fields for name, project, and permissions settings options.\" class=\"wp-image-13540 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/API-keys-OpenAI-API-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/API-keys-OpenAI-API-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/API-keys-OpenAI-API-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><\/figure>\n\n\n\n<p>In the <strong>API Keys<\/strong> section, click the <strong>+ Create new secret key<\/strong> button. A new API key will be generated and displayed.<\/p>\n\n\n\n<div class=\"wp-block-advgb-infobox advgb-infobox-wrapper has-text-align-center advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb\"><div class=\"advgb-infobox-wrap\"><div class=\"advgb-infobox-icon-container\"><div class=\"advgb-infobox-icon-inner-container\"><i class=\"material-icons-outlined\">library_books<\/i><\/div><\/div><div class=\"advgb-infobox-textcontent\"><h3 class=\"advgb-infobox-title\">Save Your API Key<\/h3><p class=\"advgb-infobox-text\"> OpenAI displays the API key only at the time of creation. Once an OpenAI API key is generated, <strong>you cannot view it again<\/strong> for security reasons. Therefore, make sure to save the API key in a text file for now, as you will have to enter it in the source code for our AI tool. If you do not save the key when it's first shown, you will need to create a new one.<\/p><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-configuring-access-to-the-icd-soft-api\">3. Configuring Access to the ICDSoft API<\/h2>\n\n\n\n<p>Now that you have access to the ChatGPT API, the next step is to set up your access to the ICDSoft API, which we will use in order to check the availability of each domain suggested by the AI. <\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-New-Account-Registration.png\"><img decoding=\"async\" width=\"1024\" height=\"918\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-New-Account-Registration-1024x918.png\" alt=\"\" class=\"wp-image-13565 size-full lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-New-Account-Registration-1024x918.png 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-New-Account-Registration-300x269.png 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-New-Account-Registration.png 1164w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/918;\" \/><\/a><\/figure><div class=\"wp-block-media-text__content\">\n<p>As previously noted, the ICDSoft API is offered at no cost, and access requires only a reseller account, which is also available free of charge. To get your free reseller account, go to <a href=\"https:\/\/accounts.icdsoft.com\/register\" target=\"_blank\" rel=\"noopener\">https:\/\/accounts.icdsoft.com\/register<\/a> and complete the registration form.<\/p>\n<\/div><\/div>\n\n\n\n<p>The next step is to log in to the <a href=\"https:\/\/accounts.icdsoft.com\" target=\"_blank\" rel=\"noopener\">Account Panel<\/a> using your login credentials. Since the ICDSoft API is designed to allow resellers to have access to information related to their hosting services, you would need to set up an online store in order to obtain an API key. The online store is where you will set up custom prices for all the available domain names that you can resell at a profit. This will allow us to not only show visitors a list of available domain names suggested by the AI, but also give them the option to register them directly.<\/p>\n\n\n\n<p>Navigate to the Online Stores menu on the left side and click on Management. There, press the \"Create a new store\" button. Enter your brand name, hosted storefont address, currency, and contact email.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-11-25-2024_06_50_AM-1-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-11-25-2024_06_50_AM-1-1024x498.webp\" alt=\"Online Store Management Interface for Creating a New Store with Form Fields for Brand Name, Address, Currency, Email\" class=\"wp-image-13572 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-11-25-2024_06_50_AM-1-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-11-25-2024_06_50_AM-1-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-11-25-2024_06_50_AM-1-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><\/figure>\n\n\n\n<p>When you press the Save button, your online store will be created. The interface will directly load the Main Settings menu of your online store, and that's where you can find your API (Authentication) key at the bottom of the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-scaled.webp\"><img decoding=\"async\" width=\"834\" height=\"1024\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-834x1024.webp\" alt=\"Store management dashboard showing general settings, API options, and storefront configuration for an online shop.\" class=\"wp-image-13577 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-834x1024.webp 834w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-244x300.webp 244w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-1251x1536.webp 1251w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Account-Panel-Store-Management-1-1668x2048.webp 1668w\" data-sizes=\"(max-width: 834px) 100vw, 834px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 834px; --smush-placeholder-aspect-ratio: 834\/1024;\" \/><\/a><\/figure>\n\n\n\n<p>For the sake of keeping our example as easy-to-understand as possible, we will switch the <strong>API security<\/strong> toggle to \"<strong>Authentication key<\/strong>\". The HMAC security is more complex, because it involves the addition of an HMAC secret in combination with the API key.  Armed with the ICDSoft API key and the key for ChatGPT's API, we are ready to move on to the next step and configure our domain generator script.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-installing-the-icd-soft-reseller-store-plugin-for-word-press\">4. Installing the ICDSoft Reseller Store Plugin for WordPress<\/h2>\n\n\n\n<p>In order for our domain name generator script to provide visitors the option of ordering the available domains, you would have to install the <a href=\"https:\/\/wordpress.org\/plugins\/icdsoft-reseller-store\/\" target=\"_blank\" rel=\"noreferrer noopener\">ICDSoft Reseller Store<\/a> plugin for WordPress. The plugin is available at the official WordPress repository, so all you need to do is go to your WordPress Dashboard &gt; Plugins &gt; Add New Plugin, and make a search for \"ICDSoft Reseller Store\" &gt; Install Now &gt; Activate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Add-Plugins-\u2039-Hecto-Host-1024x498.webp\" alt=\"WordPress plugin installation page showing ICDSoft Reseller Store with an Install Now button highlighted.\" class=\"wp-image-13714 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Add-Plugins-\u2039-Hecto-Host-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Add-Plugins-\u2039-Hecto-Host-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Add-Plugins-\u2039-Hecto-Host-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/figure>\n\n\n\n<p>With the ICDSoft Reseller Store plugin installed, navigate to its Settings menu that will show up on the panel on the left side. This will load up the configuration wizard. Since we've already created an ICDSoft reseller account, select the \"I have an account\" option.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-\u2039-Hecto-Host-1024x498.webp\" alt=\"WordPress dashboard showing ICDSoft hosting setup with options for existing account or free sign-up highlighted.\" class=\"wp-image-13715 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-\u2039-Hecto-Host-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-\u2039-Hecto-Host-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-\u2039-Hecto-Host-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><figcaption class=\"wp-element-caption\">Go to the Settings menu of the ICDSoft Reseller Store plugin &gt; select the \"I Have an Account\" option.<\/figcaption><\/figure>\n\n\n\n<p>Now, enter your ICDSoft API key under the \"API Settings\" section on the next page &gt; Authentication key. Make sure to disable the Test mode at the bottom, and press the <strong>Save Changes <\/strong>button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-reseller-store-plugin-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"599\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-reseller-store-plugin-1024x599.webp\" alt=\"WordPress plugin settings page with options for CSS, API keys, and payment test mode in a hosting store setup.\" class=\"wp-image-13716 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-reseller-store-plugin-1024x599.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-reseller-store-plugin-300x176.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/ICDSoft-Hosting-Settings-reseller-store-plugin-1536x899.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/599;\" \/><\/a><figcaption class=\"wp-element-caption\">Enter your ICDSoft API key at the Authentication Key field and make sure to disable the Test mode.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-the-domain-name-generator-script-for-word-press\">5. The Domain Name Generator Script for WordPress<\/h2>\n\n\n\n<p>Here is a quick summary of our WordPress AI tool's workflow. In short, it will take the keywords entered by the website visitor as input, send them to the ChatGPT server in an AJAX request, then the generated domain ideas are passed to the ICDSoft API to check their availability. Finally, the available domains are shown as results. We will use WordPress' built-in AJAX functionality to seamlessly display the results on the page without a refresh.<\/p>\n\n\n\n<p>Here is the complete source code of our script (you can download it at <a href=\"https:\/\/www.hectohost.com\/functions-code.txt\" target=\"_blank\" rel=\"noopener\">https:\/\/www.hectohost.com<\/a><a href=\"https:\/\/www.hectohost.com\/domain-name-generator-code.txt\" target=\"_blank\" rel=\"noreferrer noopener\">\/domain-name-generator-code.txt<\/a>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\ndefine('CHATGPT_KEY', 'REPLACE-WITH-YOUR-CHATGPT-KEY');\ndefine('ICDSOFT_KEY', 'REPLACE-WITH-YOUR-ICDSOFT-KEY');\ndefine('STORE_URL', 'REPLACE-WITH-URL-OF-YOUR-RESELLER-STORE');\n\nfunction my_child_theme_enqueue_styles() {\n    wp_enqueue_style('parent-style', get_template_directory_uri() . '\/style.css');\n}\nadd_action('wp_enqueue_scripts', 'my_child_theme_enqueue_styles');\n\n\/**\n * Create a shortcode to handle the domain AI search form submission and display results. \n *\/\n\nfunction domain_name_generator_shortcode() {\n    ob_start();\n    ?&gt;\n    &lt;form id=\"domain-generator-form\"&gt;\n        &lt;label for=\"keywords\"&gt;Enter keywords to find available domains that best match your brand:&lt;\/label&gt;&lt;br&gt;\n        &lt;input type=\"text\" id=\"keywords\" name=\"keywords\" required&gt;\n        &lt;input type=\"submit\" value=\"AI Domain Search\"&gt;\n    &lt;\/form&gt;\n&lt;div id=\"domain-results\"&gt;&lt;\/div&gt;\n    &lt;script&gt;\n        jQuery(document).ready(function($) {\n            $('#domain-generator-form').on('submit', function(e) {\n                e.preventDefault();\n                $('#domain-results').html('&lt;p&gt;Generating domain ideas...&lt;\/p&gt;');\n                $.ajax({\n                    url: '&lt;?php echo admin_url(\"admin-ajax.php\"); ?&gt;',\n                    method: 'POST',\n                    data: {\n                        action: 'generate_domains',\n                        keywords: $('#keywords').val(),\n                    },\n                    success: function(response) {\n                          console.log(response); \/\/ Check the structure of the response in the console\n                        $('#domain-results').html(response.data);\n                    },\n                    error: function() {\n                        $('#domain-results').html('&lt;p&gt;There was an error. Please try again.&lt;\/p&gt;');\n                    }\n                });\n            });\n        });\n    &lt;\/script&gt;\n    &lt;?php\n    return ob_get_clean();\n}\n\nadd_shortcode('domain_name_generator', 'domain_name_generator_shortcode');\n\nfunction handle_generate_domains() {\n    \/\/ Get user keywords\n    $keywords = sanitize_text_field($_POST&#91;'keywords']);\n    if (empty($keywords)) {\n        wp_send_json_error('Please provide keywords.');\n        return;\n    }\n\n    \/\/ Step 1: Generate domain ideas using ChatGPT\n    $chatgpt_api_key = CHATGPT_KEY;\n$chatgpt_response = wp_remote_post('https:\/\/api.openai.com\/v1\/chat\/completions', &#91;\n    'headers' =&gt; &#91;\n        'Authorization' =&gt; 'Bearer ' . $chatgpt_api_key,\n        'Content-Type'  =&gt; 'application\/json',\n    ],\n    'body' =&gt; json_encode(&#91;\n        'model' =&gt; 'gpt-3.5-turbo',\n        'messages' =&gt; &#91;\n            &#91;'role' =&gt; 'system', 'content' =&gt; 'Generate a list of domain names related to the topic: ' . $keywords],\n            &#91;'role' =&gt; 'user', 'content' =&gt; 'Please provide 10 creative domain names based on the following keywords: ' . $keywords ],\n              ],\n          'max_tokens' =&gt; 150,\n    ]),\n]);\n\nif (is_wp_error($chatgpt_response)) {\n    wp_send_json_error('Failed to communicate with ChatGPT API.');\n    return;\n}\n\n$chatgpt_body = json_decode(wp_remote_retrieve_body($chatgpt_response), true);\n\n\/\/ Debugging: Log the full response from ChatGPT\nif (defined('WP_DEBUG') &amp;&amp; WP_DEBUG) {\n    error_log(print_r($chatgpt_body, true));\n}\n\nif (empty($chatgpt_body&#91;'choices']&#91;0]&#91;'message']&#91;'content'])) {\n    wp_send_json_error('No domain ideas generated. Full response: ' . print_r($chatgpt_body, true));\n    return;\n}\n\n\/\/ Extract the domain ideas\n\nif (isset($chatgpt_body&#91;'choices']&#91;0]&#91;'message']&#91;'content'])) {\n    \/\/ Extract domain names from the response\n    $response_content = $chatgpt_body&#91;'choices']&#91;0]&#91;'message']&#91;'content'];\n    \n    \/\/ Split the response into an array by line, remove any numbers at the beginning and extra spaces\n    $domain_ideas = array_map(function($line) {\n        \/\/ Remove numbers and extra spaces\n        return trim(preg_replace('\/^\\d+\\.\\s*\/', '', $line));\n    }, explode(\"\\n\", $response_content));\n\n    \/\/ Remove any empty values from the array\n    $domain_ideas = array_filter($domain_ideas, function($domain) {\n        return !empty($domain); \/\/ Keep only non-empty domains\n    });\n\n    \/\/ Reindex the array to fix any gaps in the indexes\n    $domain_ideas = array_values($domain_ideas);\n  \n}\n    \n    \/\/ Step 2: Check availability with ICDSoft API\n    $icdsoft_api_key = ICDSOFT_KEY;\n    $icdsoft_api_url = 'https:\/\/api.suresupport.com\/domain-check';\n    $available_domains = &#91;]; \/\/initialize the array that would contain our list of avail domains\n\n    foreach ($domain_ideas as $domain) {\n        $domain = trim($domain);\n        if (empty($domain)) {\n            continue;\n        }\n      \n          error_log('clean domain passed to icd api: ' . print_r($domain, true));\n\n\/\/ Prepare the data to be sent in the request\n    $post_data = &#91;\n        \"domain\" =&gt; $domain,\n        \"auth_token\" =&gt; $icdsoft_api_key    \n    ];\n\n    \/\/ Set up the arguments for wp_remote_post\n    $args = &#91;\n        'body'        =&gt; json_encode($post_data),  \/\/ Send data as JSON\n        'headers'     =&gt; &#91;\n            'Content-Type' =&gt; 'application\/json',  \/\/ Set the header to specify JSON format\n        ],\n        'timeout'     =&gt; 15,  \/\/ Timeout in seconds\n        'httpversion' =&gt; '1.1',  \/\/ Use HTTP 1.1\n        'sslverify'   =&gt; false, \/\/ Disable SSL verification for development, enable in production\n    ];\n\n    \/\/ Send the request using wp_remote_post\n   $icdsoft_response = wp_remote_post($icdsoft_api_url, $args);\n\n                error_log('response from icd api: ' . print_r($icdsoft_response, true));\n\n      \n        if (!is_wp_error($icdsoft_response)) {\n            $icdsoft_body = json_decode(wp_remote_retrieve_body($icdsoft_response), true);\n          if (isset($icdsoft_body&#91;'data']&#91;'available']) &amp;&amp; $icdsoft_body&#91;'data']&#91;'available'] == 1) {\n                           \/\/ error_log('this domain is avail: ' . $domain);\n\n                $available_domains&#91;] = $domain;\n            }\n        }\n    }\n\n    \/\/ Step 3: Display results\n    if (empty($available_domains)) {\n        wp_send_json_success('&lt;p&gt;No available domains were found based on your keywords.&lt;\/p&gt;');\n    } else {\n        $output = '&lt;h2&gt;Available Domain Names:&lt;\/h2&gt;&lt;ul&gt;';\n        foreach ($available_domains as $domain) {\n            $order_url = STORE_URL . '\/hostingorder\/?domain=' . urlencode($domain);\n            $output .= '&lt;li&gt;' . esc_html($domain) . ' is available!' . ' &lt;a href=\"' . $order_url . '\"target=\"_blank\"&gt;Order&lt;\/a&gt;&lt;\/li&gt;';\n        }\n        $output .= '&lt;\/ul&gt;';\n        wp_send_json_success($output);\n    }\n}\n\nadd_action('wp_ajax_generate_domains', 'handle_generate_domains');\nadd_action('wp_ajax_nopriv_generate_domains', 'handle_generate_domains');\n<\/code><\/pre>\n\n\n\n<p>All you need to do is enter your API keys for ChatGPT and ICDSoft, and the URL of your reseller store at the start of the script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('CHATGPT_KEY', 'REPLACE-WITH-YOUR-CHATGPT-KEY');\ndefine('ICDSOFT_KEY', 'REPLACE-WITH-YOUR-ICDSOFT-KEY');\ndefine('STORE_URL', 'REPLACE-WITH-URL-OF-YOUR-RESELLER-STORE');<\/code><\/pre>\n\n\n\n<p>The URL of your store is set when you first configure your online store via the <a href=\"https:\/\/accounts.icdsoft.com\" target=\"_blank\" rel=\"noreferrer noopener\">ICDSoft Account Panel<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Account-Panel-Store-Management-store-url-1024x498.webp\" alt=\"Dashboard of online store management settings for Hecto Host including storefront address and contact email configuration.\" class=\"wp-image-13710 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Account-Panel-Store-Management-store-url-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Account-Panel-Store-Management-store-url-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Account-Panel-Store-Management-store-url-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><figcaption class=\"wp-element-caption\">You can find the URL of your online store at the Account Panel &gt; Online Stores &gt; Management &gt; Mail Settngs.<\/figcaption><\/figure>\n\n\n\n<p>Here is a quick explanation of the main parts of the code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form id=\"domain-generator-form\"&gt;\n        &lt;label for=\"keywords\"&gt;Enter keywords to find available domains that best match your brand:&lt;\/label&gt;&lt;br&gt;\n        &lt;input type=\"text\" id=\"keywords\" name=\"keywords\" required&gt;\n        &lt;input type=\"submit\" value=\"AI Domain Search\"&gt;\n    &lt;\/form&gt;<\/code><\/pre>\n\n\n\n<p>This part creates the input form for our website visitors, who will be required to enter a  description of their idea or business. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;\n        jQuery(document).ready(function($) {\n            $('#domain-generator-form').on('submit', function(e) {\n                e.preventDefault();\n                $('#domain-results').html('&lt;p&gt;Generating domain ideas...&lt;\/p&gt;');\n                $.ajax({\n                    url: '&lt;?php echo admin_url(\"admin-ajax.php\"); ?&gt;',\n                    method: 'POST',\n                    data: {\n                        action: 'generate_domains',\n                        keywords: $('#keywords').val(),\n                    },\n                    success: function(response) {\n                        $('#domain-results').html(response.data);\n                    },\n                    error: function() {\n                        $('#domain-results').html('&lt;p&gt;There was an error. Please try again.&lt;\/p&gt;');\n                    }\n                });\n            });\n        });\n    &lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>This is where we use WordPress' built-in AJAX functionality to send the domain name description (keywords) entered by the user over to the server for processing. As explained in our workflow, the server-side processing consists of sending the keywords to ChatGPT to get a list of domain names matching our description, and then check their availability via the ICDSoft API. The last segment displays the results or shows an error in case we cannot obtain any results.<\/p>\n\n\n\n<p>The following line is very important:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_shortcode('domain_name_generator', 'domain_name_generator_shortcode');\n<\/code><\/pre>\n\n\n\n<p>It creates a shortcode named 'domain_name_generator'. It allows us to place our domain name generator on any WordPress post or page simply by adding that shortcode in an HTML widget. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ Step 1: Generate domain ideas using ChatGPT\n    $chatgpt_api_key = CHATGPT_KEY;\n$chatgpt_response = wp_remote_post('https:\/\/api.openai.com\/v1\/chat\/completions', &#91;\n    'headers' =&gt; &#91;\n        'Authorization' =&gt; 'Bearer ' . $chatgpt_api_key,\n        'Content-Type'  =&gt; 'application\/json',\n    ],\n    'body' =&gt; json_encode(&#91;\n        'model' =&gt; 'gpt-3.5-turbo',\n        'messages' =&gt; &#91;\n            &#91;'role' =&gt; 'system', 'content' =&gt; 'Generate a list of domain names related to the topic: ' . $keywords],\n            &#91;'role' =&gt; 'user', 'content' =&gt; 'Please provide 10 creative domain names based on the following keywords: ' . $keywords ],\n              ],\n          'max_tokens' =&gt; 150,\n    ]),\n]);<\/code><\/pre>\n\n\n\n<p>This part submits our keywords to the OpenAI API. It's important to take note of their endpoint - https:\/\/api.openai.com\/v1\/chat\/completions. You can see that we are using the gpt-3.5-turbo language model, which is much more cost-effective compared to GPT-4, and yet it still produces great results. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;'role' =&gt; 'system', 'content' =&gt; 'Generate a list of domain names related to the topic: ' . $keywords],<\/code><\/pre>\n\n\n\n<p>This line tells ChatGPT what we want it to do - \"Generate a list of domain names related to our keyword. \"<\/p>\n\n\n\n<p>The remainder of the code sends the generated domains (one by one) over to the ICDSoft API to do a WHOIS check on their availability. Only the available domains are then displayed as results with a link to register. <\/p>\n\n\n\n<p>As we pointed out previously, ChatGPT can be used to perform complex tasks, and that includes creating entire WordPress AI tools and scripts such as this one. Of course, the code it generates probably won't work right away, and you will have to tinker with it and modify it here and there, but overall, it does a pretty good job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5-integrating-our-ai-tool-with-word-press\">6. Integrating Our AI Tool with WordPress<\/h2>\n\n\n\n<p>Since our domain generator tool for WordPress works as a shortcode, allowing you to easily add it anywhere you want, the code provided in the previous step should be added to your theme's functions.php file. However, if you add this code directly to the functions.php file of your active theme, it will get overwritten every time you update the theme, essentially removing that code and causing our WordPress AI tool to no longer work.<\/p>\n\n\n\n<p>To avoid this problem, we will use the so-called WordPress \"child theme\". A child theme inherits all the functionality, features, and styles of its parent theme, while giving you the option to apply customizations that won't be overwritten when the original (parent) theme is updated.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress-1024x498.webp\" alt=\"WordPress dashboard showing installed themes, active Astra Child theme, and an option to add new theme.\" class=\"wp-image-13601 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/figure>\n\n\n\n<p>The way a child theme works is by having its own functions.php file where you apply your custom code and also load the functions.php and style.css files of the original (parent) theme. In that way, when the parent theme is updated, its functions.php file gets overwritten (with all the new stuff part of the update), but your child theme's functions.php remains intact. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-1-setting-up-a-word-press-child-theme\">6.1 Setting Up a WordPress Child Theme<\/h3>\n\n\n\n<p>Here are the steps to follow in order to create a child theme for your WordPress installation. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check the name of your current active theme. This information is available at your WordPress Dashboard &gt; Appearance &gt; Themes. Look for the one labelled as \"Active\".<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress--scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress--1024x498.webp\" alt=\"WordPress Dashboard Theme Selection Screen with Astra Theme Active and Options to Customize or Add New Theme\" class=\"wp-image-13596 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress--1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress--300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Themes-\u2039-Hecto-Host-\u2014-WordPress--1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><figcaption class=\"wp-element-caption\">You can find the theme you are using via the WordPress Dashboard &gt; Appearance &gt; Themes menu. There, look for the one with the \"Active\" label. We are using Astra for our website.<\/figcaption><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>2. Using the File Manager at your web host or via FTP, navigate to the folder where your WordPress installation resides. Once there, go to the wp-content &gt; themes folder, and create a new folder for your child theme (e.g., parent-theme-name-child). Since we are using the Astra theme, we will create a new folder named astra-child.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"559\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-File-Manager-1024x559.webp\" alt=\"File Manager interface showing highlighted astra-child folder in wp-content\/themes directory.\" class=\"wp-image-13597 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-File-Manager-1024x559.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-File-Manager-300x164.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-File-Manager-1536x839.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/559;\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>3. Create a style.css file in the child theme folder and add the following code in it:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n Theme Name:   Astra Child\n Theme URI:    https:\/\/wpastra.com\n Description:  A child theme for the Astra theme\n Author:       Brainstorm Force\n Author URI:   https:\/\/wpastra.com\n Template:     astra\n Version:      1.0.0\n*\/\n\/* Custom styles go below *\/<\/code><\/pre>\n\n\n\n<p>Of course, you should replace the Theme Name, URI and Template to match those of your theme. The important part is that you can place your own CSS code below. Again, it would not be overwritten in the event of a parent theme update.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>4. Create a file named functions.php under your child theme's folder (e.g. \/astra-child\/functions.php), and add the entire source code of our domain generator script provided in the previous chapter.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6-2-activating-our-word-press-child-theme\">6.2 Activating our WordPress Child Theme<\/h2>\n\n\n\n<p>Once you've created your WordPress child theme with the actual functions.php and style.css files inside its folder, the next step is to actually switch the active theme for your WordPress installation to the child theme. This is done via the Appearance &gt; Themes menu, where you need to press the <strong>Activate<\/strong> button next to the child theme that will appear on the list of available themes. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Themes-\u2039-Hecto-Host-child-theme-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Themes-\u2039-Hecto-Host-child-theme-1024x498.webp\" alt=\"WordPress dashboard showing theme selection, highlighting the activation of the Astra Child theme with a red arrow.\" class=\"wp-image-13713 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Themes-\u2039-Hecto-Host-child-theme-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Themes-\u2039-Hecto-Host-child-theme-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/12\/Themes-\u2039-Hecto-Host-child-theme-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><figcaption class=\"wp-element-caption\">Once you've created your WordPress child theme, it's really important to activate it via the Appearance &gt; Themes menu.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5-2-adding-the-domain-name-generator-to-our-word-press-page\">6.3 Adding the Domain Name Generator to Our WordPress Page<\/h2>\n\n\n\n<p>Now that we have set our child theme and added our domain name generator code to its functions.php file, we can safely proceed to add the actual WordPress AI tool to our website. Since we configured our AI tool to work as a shortcode, all you need to do is add the [domain_name_generator] shortcode on your WordPress post or page, and it will magically appear. This will work regardless of the builder you are using - whether it's Divi, Elementor, Gutenberg, or any other WordPress website builder.<\/p>\n\n\n\n<p>In our case, we have created a new page named Domains and added a header copied from one of the existing pages and just modified its text and image. We're using Elementor, so below the header we've placed a <strong>Heading<\/strong> element and set its Title to <em>\"Discover Domain Names That Tell Your Brand\u2019s Story\"<\/em>. In order to have the <strong>Heading<\/strong> element at the center, we've changed its <strong>Alignment<\/strong> to Center via the <strong>Style<\/strong> tab, and we added some padding on the Left and Right sides via the <strong>Advanced<\/strong> tab.<\/p>\n\n\n\n<p>The last step is to add our actual WordPress AI tool, and that's done by placing an HTML element (press the \"+\" sign at the upper-left corner and then search for \"html\"). <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domain-Name-Generator-with-Elementor-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domain-Name-Generator-with-Elementor-1024x498.webp\" alt=\"AI-powered tool for finding the perfect domain name with a colorful magnifying glass illustration and editable widgets.\" class=\"wp-image-13604 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domain-Name-Generator-with-Elementor-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domain-Name-Generator-with-Elementor-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domain-Name-Generator-with-Elementor-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><\/figure>\n\n\n\n<p>Inside that HTML Code element, we just need to enter our shortcode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;domain_name_generator]<\/code><\/pre>\n\n\n\n<p>The form will not appear while you are editing the page. It will only show up<strong> <\/strong>on our live website after <strong>publishing<\/strong> the changes and while <strong>previewing<\/strong> the actual page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domains-with-Elementor-1-scaled.webp\"><img decoding=\"async\" width=\"1024\" height=\"498\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domains-with-Elementor-1-1024x498.webp\" alt=\"AI-powered tool for finding perfect domain, including HTML code snippet labeled domain_name_generator.\" class=\"wp-image-13606 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domains-with-Elementor-1-1024x498.webp 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domains-with-Elementor-1-300x146.webp 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/Edit-Domains-with-Elementor-1-1536x746.webp 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/498;\" \/><\/a><\/figure>\n\n\n\n<p>Once you publish that page, the domain name generator should automatically show up. Provided that your ChatGPT and ICDSoft keys are correct, it should generate valid results for the domain ideas you and your visitors are looking for. <\/p>\n\n\n\n<p>If everything works as expected, you can complete the process by pushing the changes from the staging WordPress installation over to your live site. For ICDSoft customers, this is as easy as pressing the \"Set as live\" button next to the staging instance at the WordPress Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"277\" data-src=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-set-as-live-1024x277.png\" alt=\"Staging dashboard for managing WordPress sites with options to set live, showing site URLs, paths, and version numbers.\" class=\"wp-image-13609 lazyload\" data-srcset=\"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-set-as-live-1024x277.png 1024w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-set-as-live-300x81.png 300w, https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/hectohost-com-Control-Panel-WordPress-Manager-set-as-live-1536x416.png 1536w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/277;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Artificial Intelligence is transforming how we interact with technology, and integrating its capabilities into your WordPress site can set you apart from the competition. By combining the power of AI with WordPress, as demonstrated with the domain name generator example, you can create dynamic, user-focused tools that enhance the visitor experience, improve engagement, and potentially boost revenue.<\/p>\n\n\n\n<p>The possibilities for AI in WordPress are vast, ranging from intelligent search features to chatbots, fraud detection, and beyond. With the foundational knowledge provided here, you can expand your horizons to develop innovative solutions tailored to your audience\u2019s needs\u2014not only in WordPress, but in any digital environment.<\/p>\n<style class=\"advgb-styles-renderer\">#advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482, .advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 {background-color: #f5f5f5;padding: 20px 20px 20px 20px;border: 0px solid #e8e8e8 ;border-radius: 0px;}#advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-icon-container, .advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-icon-container {background-color: #f5f5f5;padding: 0;margin: 0;border: 0px solid #e8e8e8 ;border-radius: 0px;}#advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-icon-container i, .advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-icon-container i {color: #ff6900;font-size: 70px;display: block;}#advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-textcontent .advgb-infobox-title, .advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-textcontent .advgb-infobox-title {color: #333;padding: 0;margin: 5px 0 10px 0;white-space: pre-wrap;}#advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-textcontent .advgb-infobox-text, .advgb-infobox-a01e9729-d1d9-459f-bbee-e0968f61c482 .advgb-infobox-textcontent .advgb-infobox-text {color: #333;padding: 0;margin: 0;white-space: pre-wrap;}#advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb, .advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb {background-color: #f5f5f5;padding: 20px 20px 20px 20px;border: 0px solid #000000;border-radius: 0px;}#advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-icon-container, .advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-icon-container {background-color: #f5f5f5;padding: 0;margin: 0;border: 0px solid #e8e8e8 ;border-radius: 0px;}#advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-icon-container i, .advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-icon-container i {color: #ff6900;font-size: 70px;display: block;}#advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-textcontent .advgb-infobox-title, .advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-textcontent .advgb-infobox-title {color: #333;padding: 0;margin: 5px 0 10px 0;white-space: pre-wrap;}#advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-textcontent .advgb-infobox-text, .advgb-infobox-7c4f2645-182a-4695-bf5f-d3f55f540dbb .advgb-infobox-textcontent .advgb-infobox-text {color: #333;padding: 0;margin: 0;white-space: pre-wrap;}#advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb, .advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb {background-color: #f5f5f5;padding: 20px 20px 20px 20px;border: 0px solid #000000;border-radius: 0px;}#advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-icon-container, .advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-icon-container {background-color: #f5f5f5;padding: 0;margin: 0;border: 0px solid #e8e8e8 ;border-radius: 0px;}#advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-icon-container i, .advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-icon-container i {color: #ff6900;font-size: 70px;display: block;}#advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-textcontent .advgb-infobox-title, .advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-textcontent .advgb-infobox-title {color: #333;padding: 0;margin: 5px 0 10px 0;white-space: pre-wrap;}#advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-textcontent .advgb-infobox-text, .advgb-infobox-b0c0d25b-0bcd-4a44-b9cc-eeed559a89cb .advgb-infobox-textcontent .advgb-infobox-text {color: #333;padding: 0;margin: 0;white-space: pre-wrap;}<\/style>","protected":false},"excerpt":{"rendered":"<p>Today, we will take things a step further, by showing you how to actually build a fully working AI-driven tool for your WordPress website, step-by-step.<\/p>\n","protected":false},"author":1,"featured_media":13489,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"categories":[1,3,4,5,51,11],"tags":[],"class_list":{"0":"post-13482","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-general","8":"category-how-to","9":"category-resellers","10":"category-tech","11":"category-websites","12":"category-wordpress"},"author_meta":{"display_name":"ICDSoft","author_link":"https:\/\/www.icdsoft.com\/blog\/author\/icdsoft\/"},"featured_img":"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/how-to-use-a-1-300x200.webp","featured_image_src":"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/how-to-use-a-1.webp","featured_image_src_square":"https:\/\/www.icdsoft.com\/blog\/wp-content\/uploads\/2024\/11\/how-to-use-a-1.webp","author_info":{"display_name":"ICDSoft","author_link":"https:\/\/www.icdsoft.com\/blog\/author\/icdsoft\/"},"coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/general\/\" class=\"advgb-post-tax-term\">General<\/a>","<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/how-to\/\" class=\"advgb-post-tax-term\">How To<\/a>","<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/resellers\/\" class=\"advgb-post-tax-term\">Resellers<\/a>","<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/tech\/\" class=\"advgb-post-tax-term\">Technology<\/a>","<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/websites\/\" class=\"advgb-post-tax-term\">Websites<\/a>","<a href=\"https:\/\/www.icdsoft.com\/blog\/category\/wordpress\/\" class=\"advgb-post-tax-term\">WordPress<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">General<\/span>","<span class=\"advgb-post-tax-term\">How To<\/span>","<span class=\"advgb-post-tax-term\">Resellers<\/span>","<span class=\"advgb-post-tax-term\">Technology<\/span>","<span class=\"advgb-post-tax-term\">Websites<\/span>","<span class=\"advgb-post-tax-term\">WordPress<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 2 years ago","modified":"Updated 2 years ago"},"absolute_dates":{"created":"Posted on December 4, 2024","modified":"Updated on December 4, 2024"},"absolute_dates_time":{"created":"Posted on December 4, 2024 10:07 am","modified":"Updated on December 4, 2024 10:07 am"},"featured_img_caption":"how to build wordpress ai tool","series_order":"","_links":{"self":[{"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/posts\/13482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=13482"}],"version-history":[{"count":92,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/posts\/13482\/revisions"}],"predecessor-version":[{"id":13729,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/posts\/13482\/revisions\/13729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/media\/13489"}],"wp:attachment":[{"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=13482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=13482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icdsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=13482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}