Automating Bulk Title Tag and Meta Description Writing With OpenAI GPT-3

by | 0 comments

The problem

As an SEO, writing lots of title tags and meta descriptions can get very tedious very quickly.

So why not automate this work?

ChatGPT has taken the internet by storm and shown itself to be great at tackling these sorts of tasks, see an example result from asking ChatGPT to create a meta description below:

 

 

Of course the outputs from ChatGPT are not perfect, but they can form a great basis to work off of and with some light editing are at least in my personal experience so far quite usable or acceptable.

Sadly, as of this writing circa January of 2023, the only way to interact with ChatGPT is via OpenAI’s app in a web browser 1 on 1.

For bulk operations or other commercial use cases, this doesn’t scale well.

Enter the GPT-3 text-davinci-003 model and associated API.

It’s capable of producing similar or identical results as ChatGPT, but most importantly, it has an API available.

What is a good way of interacting with this API that is approachable, easy to get started with, and straightforward you might be asking?

Google Sheets and an Apps Script to talk to OpenAI’s API can get the job done.

With a Google Sheet and a simple Apps Script, we can use OpenAI’s text-davinci-003 to generate both meta descriptions and title tags (and a whole lot more) in batches and potentially even directly import the results into a CMS system or other application.

Spreadsheet template

With all of this in mind, I’ve created a spreadsheet template that can help you do the following:

  • Write a meta description from a URL or a text block
  • Write title tags from a URL or a text block

Link to the spreadsheet template is below, and a guide on how to use it can be found below here and also on the first “Readme” tab of the spreadsheet.

Make your own copy of the spreadsheet template by clicking here.

How to

Getting your OpenAI API Key

New OpenAI Users

  1. Visit the OpenAI website at openai.com
  2. Click ‘Get Started’ in the top right corner
  3. Create a new OpenAI account by entering your email address and creating a password
  4. Verify your email address
  5. Log into your OpenAI account
  6. Click the ‘API Keys’ tab
  7. Click ‘Create New Key’
  8. Enter a name for your key and click ‘Create Key’
  9. Your API key will be displayed. Copy it and store it securely.

Existing OpenAI Users

  1. Visit the OpenAI website and log into your account.
  2. Click on your profile name in the top right corner of the page.
  3. On the left side menu, select the ‘API Keys’ tab.
  4. Here you will see a list of all your API keys associated with your account.
  5. You can click the ‘Create a new key’ button
  6. A new API key will be generated for you and will be displayed on the screen.
  7. Copy and save this key as it will only be displayed once.

Adding your API Key to Sheets

  1. At the top, click on “Extension” > “App Script”
  2. At the very first row of the code, insert your API Key in between the double quotes. (Note: Please make sure that there are no extra spaces.)
  3. Save the code by clicking the Save project icon or pressing CTRL + S.
  4. Once saved, you’re now ready to use the generator.

Column Helper

  • Prompt – A non-input field of pre-defined string of text used to provide a context for the generation of an AI’s response.
  • URL or Text – An input field for entering a URL or plain text.
  • Focus Keyword (Optional) – An optional input field for entering a keyword or phrase to focus on when creating the meta description.
  • Meta Description/Title Tag Result – A non-input field to display the generated meta description/title tag based on the entered URL or text.

How to use the Generator Sheet

  1. Go to Meta Description Generator or Title Tag Generator
  2. Enter your desired URL or text in the URL or Text field (Column B). Integrated formulas will be able to detect automatically if the input is a URL or a text.
  3. To create a result that is more targeted, you can enter keyword(s) in the Focus Keyword field (Column C)
  4. Once done, Prompt and Result will automatically be generated based on the user input.
  5. Note: Prompt and Result fields are formulated, manually entering text in this fields may cause to broken formulas.
  6. You can always undo your action by pressing CTRL + Z.

In conclusion

First, a big high five and thank you is due here to Elliott Davidson from Contrast Digital and the example he recently shared of using Google Sheets to automate eCommerce product descriptions with OpenAI GPT-3 text-davinci-003 which formed the basis of my work above.

Using Google Sheets Apps Scripts in this way is incredibly straightforward, it does a great job of removing external dependencies and costs that building something similar using OpenAI’s Zapier connector and Google Sheets would create.

Hopefully this is just the beginning of many potentially useful applications of GPT-3 that are scalable and solve real world problems or pain points.

What do you want to build?

0 Comments
Submit a Comment

Your email address will not be published. Required fields are marked *