te a Chrome SEO extension with ChatGPT
Chrome extensions make it easy to perform boring, repetitive tasks. SEO can benefit from extensions. Many still do not focus on creating them.
Some marketers cannot code complex tools and so use the simplest tool available. You don’t have to spend money or time on a developer to create a complex tool.
You can now use ChatGPT for free to create your own SEO extensions. Upload them to Google, and use them every day. Here’s how.
Step 1: Identify the requirements
The first step is to have a clear idea of what your Chrome extension will do. I would advise content marketers think about it before they begin to ask ChatGPT for help and write down clear and specific requirements.
There are two main types of requirements:
- Task – What is your need for an extension?
- The feature: How would you like your extension to display the information?
Disclaimer This process is for creating an extension that only works on your computer. You will not be able sell it or make available on Chrome Store. To make this happen, you will need to follow the Google guidelines. You can find them here .
In this guide, I’ll show you how to build a simple SEO Chrome Extension. Here are my requirements.
Information required
I would like my SEO Chrome Extension to show me all page elements so that I can get a quick overview without having to dig into the code of the backend page.
- Page title
- Meta description
- Copy headers
- List of internal links, including URLs
- Images including URLs
- Canonical URL
Features and behavior requirements
When I click on the icon of my extension in Chrome, I want a popup to appear.
Below, you can see the final product and how it will look on Chrome.
Note: For simplicity, this is the basic version of extension. It does not include CSS styling. This guide focuses on the functionality and not the styling.
You’ll want to make sure that, as you can see from the image above you will be able to view the results on your Chrome tab in a pop-up.
The majority of SEO extensions are designed to provide the necessary information on a popup window that appears when you click the icon.
Step 2: Create a detailed description of ChatGPT
You can now go to ChatGPT and write detailed instructions. Your prompt should be as specific as possible.
The majority of prompts that I see marketers use are short. You’ll also get poor results from short prompts.
How to do it?
You need to first give ChatGPT a goal. You can do this by using the same requirements as in Step 1, along with a command line.
-
Write me the code for a Chrome extension to help me identify on-page elements of SEO on any website. Identifying elements: H1,H2,H3, page title and meta description, canonical url, number of H1s and H2s, and internal links, including URLs ).”
After you’ve given ChatGPT your goals, you can now specify how you would like the extension to behave. We’ll use the pop-up feature with buttons for this. This is how you do it:
-
“Feature of Chrome Extension: When the extension is clicked a window appears. This window has a menu that can be clicked. You show me three options in the menu. The first button gives me instructions on how to install the extension. The second button shows me the page title, meta descriptions, H1, H2, and H3 tags. The third button shows the number H1 and H2, internal links, including URLs ).”
It is important to be specific in what we are trying to accomplish. You’ll need to add the last sentence of the prompt describing how you want to upload it.
-
“Give each file to me separately, with its name.”
You are now asking ChatGPT for the file to be split into smaller parts. It is crucial to note this because Step 4 follows. Hold on to your hats.
Step 3: Ask ChatGPT for the code
It’s now time to copy and paste all the sentences that we have written into ChatGPT.
ChatGPT allows you to easily write code.
According to our instructions, ChatGPT provides you with four different codes.
Note When creating a Chrome extension, it’s normal to need several different types of files depending on the complexity. In this example, you only need to upload four different types of files inside your Chrome Account.
- Manifest.json
- Popup.html
- Popup.js
- Content.js
ChatGPT is a tool that allows marketers to avoid learning how to create these technical files. This guide will explain what they’re for.
If you want to learn more, Google has a guide on Chrome Browser Actions. Google has a guide that explains Chrome browser actions in more detail.
Manifest.json
The manifest.json configuration file is required by every Chrome extension.
This file contains meta-data about the extension such as its name and version, iconography, permissions, and description. The default popup file that will be displayed after clicking the extension.
Popup.html
It defines the layout and content that will be displayed when the extension’s icon is clicked. The popup.html file defines the layout and the content that will appear when the icon of the Chrome extension is clicked.
This includes buttons to provide instructions, statistics and SEO elements. It also has a section for the results, which displays all of the information gathered.
Popup JS
The popup.js contains JavaScript code which interacts with the UI for the Chrome extension.
This script handles the button clicks, and sends messages to a content script (not provided in the code provided) to retrieve the SEO elements of the currently active page.
When the buttons are clicked, it also updates the user interface to display the information in the result section.
Content.js
Content.js is responsible for extracting data from the content of the webpage.
It will then perform the task.
Step 4: Export ChatGPT codes to files
The next step, once we have codes and three different types of files in hand, is to convert the information from these files into a format that can be used by the Chrome Extension.
How to do it:
Sublime Text App Download
Sublime text is a free editor that supports all programming and markup language. Users can download and upload the files.
Copy and paste codes
We need to copy and paste the code from ChatGPT into the Sublime Text tabs before we can download it on our desktop.
The codes will be pasted in each tab.
After you click “Paste”, there may be a tab that does not have a title, and looks like this.
Sublime Text does not automatically pick up titles in the code samples I’m using for this guide. You’ll need to manually add these.
You can change the file names when you save them on your desktop. This will not change your extension.
You can save the files in a folder called “My SEO Extension” or similar.
Step 5: Upload your files to the Chrome Extension account
It’s now time to upload your files. We have just finished the most difficult part of the guide – writing the code.
To do this, open the Chrome Extensions Dashboard here: chrome://extensions/
Follow these steps once inside to upload your files correctly:
- Click on “Developer Mode” at the top-right corner of your browser. You can now access the upload feature.
- Select your four files and click “Load Unpacked”.
If you’re on a Mac, this window will appear when you click “Load unpacked”.
Upload the four files to Chrome’s extension dashboard. You should see the extension listed like this if you’ve done everything right:
Your extension is now almost ready for testing.
The extension has three buttons:
- Click on the instruction button to find out how to use it.
- The button for SEO on-page components.
- The Links button.
You can read all the information on the page and quickly assess whether it is optimized for search.
Step 6: Troubleshooting the code and cleaning it up
You shouldn’t be concerned if your Chrome extension has errors. They are not avoidable, but they can easily be fixed.
The code in the current version of ChatGPT refers to Google guidelines that existed before December 2021. Since then, many things have changed.
Deprecated Manifest Version
The code may be outdated and not compatible with the latest Chrome extension requirements.
Google is asking you to update your Manifest.json files from January 2023.
This type of error is very common.
You can fix the problem by selecting “manifest_version: 2” in your Sublime text file, and replacing the “2” (the previous version) with “3”, the most recent version.
Upload the extension once more.
Failure to load extension
Remove all images and icons.
You’ll receive an error message that reads “failure to load extension”. We haven’t specified a URL for the icons and images of the extensions.
In this case, it’s not necessary to add images or icons. So, it makes sense to delete the part of code that requires it.
How to do it?
- Open the Manifest.json File.
- Find the code lines that refer to the icons. In my example, there are lines 6 to 10 as well as 16 to 20
- Save your file after removing these lines.
- Upload it again on the dashboard.
We should now have a new extension that is free of ChatGPT errors and ready for testing.
This is what you will see if you have done everything correctly – or at least something similar.
Create your own SEO Chrome Extensions
It can be frustrating to keep failing, especially if your programming skills are lacking. I’ve been there.
Remember that there are no rules in AI for writing descriptions that describe what you want. It may be necessary to update your prompt several times in order to get it to work the way you want it to.
You can fix errors by minimizing them.
- Copy the error, paste it into ChatGPT and ask for it to be fixed. The tool will usually explain in plain English what’s wrong with your code. Make the recommended improvements.
- If you think your code is too complex and long, try removing some extension requirements. Start small. Start small. Test the extension and then add more requirements.
- Google is a great option if ChatGPT does not provide a solution. There’s a good chance that someone else has already solved the problem.
This guide will hopefully help you to start using ChatGPT, and build your next extension for SEO.
The article Create a Chrome SEO extension with ChatGPT first appeared on Search Engine land.