[METHOD] Make Your Own PAA Site With OpenAI - Complete Tutorial + FREE Python Script

Thanks for your guide.

Im on pycharm and installed relevant packages, on windows 10.

In the output file I'm getting topics and empty cells for "Generated Content"

Any idea?
 
Thanks for your guide.

Im on pycharm and installed relevant packages, on windows 10.

In the output file I'm getting topics and empty cells for "Generated Content"

Any idea?

Sorry for asking this.
I asked ChatGPT itself to resolve the coding issue and got it sorted. It was leading and ending spaces causing issues with saving them to csv!
 
No need to waste money on buying PAA sites. You can make your own PAA site with hundreds of posts in a few hours.

Here's an easy tutorial and python script to make your own PAA site.

I don't like combining multiple PAA questions in one post so tutorial will show you how to create an article for each PAA question.

The only thing you'll need to refine is the prompt you use to create the content with OpenAI. I've included a very basic prompt. The output with this prompt is not going to be great. The output may even be too short to be usable.

You'll need to come up with your own prompts that are tailored for your niche.

DO NOT skip this step.

Prompts are the most important part of the entire process. Take some time and come up with a great prompt that'll produce high quality content.




Step 1: Select a niche

I recommend selecting a sub-niche within a broader niche. Working with smaller niches is much easier and you can build topical authority and rank quickly. For this tutorial, I'm going to use "Yerba Mate" as an example.

If this is your first time, I recommend selecting a super small niche like the one in the example.

Step 2: SEO Minion

Step 2 is straight forward. Use a VPN server in your target country, Google the main head term and scrape the PAA using the SEO Minion Chrome extension. You can use as many levels as you like. I'm using 8 levels for this example.

Step 3: Remove Duplicates

Use Excel/Numbers/Google Sheets to remove the duplicate PAAs. SEO Minion doesn't remove the duplicates so it has to be done manually. Also, make sure that all the PAA's are related to the topic. Sometimes, the PAA's have no relation to the topic. I suggest taking the time and manually going through the questions. Remove anything that isn't relevant.

Step 4: Prepare The CSV

We need to prepare the CSV for the script. It's pretty easy to do.

This is the output from SEO Minion:

View attachment 239045


Delete all the columns except PAA Title and Text. Rename PAA title to topic. Rename Text to context.

This is how the final CSV should look:

View attachment 239046

Rename the file as "input.csv".

Step 5: Use OpenAI to Generate Content

You're now ready to generate content using the OpenAI API. You'll need to use your OpenAI API key.

Here's the Python code you need to use:

Code:
import openai
import pandas as pd

df = pd.read_csv("input.csv")

# Set OpenAI API key
openai.api_key = "YOUR_API_KEY"

results = []

for index, row in df.iterrows():
 
    prompt = f"Please write a detailed article about {row['topic']}. Use this information to write the article: {row['context']}"
    response = openai.Completion.create(engine="text-davinci-003", prompt=prompt, temperature=0.7,max_tokens=2048,top_p=0.5)
    results.append([row['topic'], response.choices[0].text])

output_df = pd.DataFrame(results, columns = ['Topic', 'Generated Text'])

output_df.to_csv('output.csv', index=False)

In its basic form, the prompt will use the PAA answer as context to write the article. Assuming that the PAA answer that Google shows is accurate, the output generated using that as context should generate more accurate content.

Once again, YOU NEED TO CHANGE THE PROMPT. Please don't use this prompt because the output will be pathetic and short. The variable for the topic is {row['topic']} and the context is {row['context']}. Use these in your own prompt any way you see fit.

You need to customize your prompts for your specific niche. Ideally, you'd want custom prompts for each article but that takes too long when you're creating bulk content.

The output will be saved as a CSV.

Step 6: Use WP All Import

Use the WP All Import plugin to upload the content to your site. There are several tutorials that go over how you can do that. You can use some plugins for images etc.




That's pretty much it. It's super easy to get started. There are several ways to improve the output you get from OpenAI but I'm not going to get into that here.

You can also use this script for other types of content or for inserting researched data into a prompt.


Great share and great idea, highly appreciated.
 
Sorry for asking this.
I asked ChatGPT itself to resolve the coding issue and got it sorted. It was leading and ending spaces causing issues with saving them to csv!

Great. I’m glad you managed to get it to work.
 
No need to waste money on buying PAA sites. You can make your own PAA site with hundreds of posts in a few hours.

Here's an easy tutorial and python script to make your own PAA site.

I don't like combining multiple PAA questions in one post so tutorial will show you how to create an article for each PAA question.

The only thing you'll need to refine is the prompt you use to create the content with OpenAI. I've included a very basic prompt. The output with this prompt is not going to be great. The output may even be too short to be usable.

You'll need to come up with your own prompts that are tailored for your niche.

DO NOT skip this step.

Prompts are the most important part of the entire process. Take some time and come up with a great prompt that'll produce high quality content.




Step 1: Select a niche

I recommend selecting a sub-niche within a broader niche. Working with smaller niches is much easier and you can build topical authority and rank quickly. For this tutorial, I'm going to use "Yerba Mate" as an example.

If this is your first time, I recommend selecting a super small niche like the one in the example.

Step 2: SEO Minion

Step 2 is straight forward. Use a VPN server in your target country, Google the main head term and scrape the PAA using the SEO Minion Chrome extension. You can use as many levels as you like. I'm using 8 levels for this example.

Step 3: Remove Duplicates

Use Excel/Numbers/Google Sheets to remove the duplicate PAAs. SEO Minion doesn't remove the duplicates so it has to be done manually. Also, make sure that all the PAA's are related to the topic. Sometimes, the PAA's have no relation to the topic. I suggest taking the time and manually going through the questions. Remove anything that isn't relevant.

Step 4: Prepare The CSV

We need to prepare the CSV for the script. It's pretty easy to do.

This is the output from SEO Minion:

View attachment 239045


Delete all the columns except PAA Title and Text. Rename PAA title to topic. Rename Text to context.

This is how the final CSV should look:

View attachment 239046

Rename the file as "input.csv".

Step 5: Use OpenAI to Generate Content

You're now ready to generate content using the OpenAI API. You'll need to use your OpenAI API key.

Here's the Python code you need to use:

Code:
import openai
import pandas as pd

df = pd.read_csv("input.csv")

# Set OpenAI API key
openai.api_key = "YOUR_API_KEY"

results = []

for index, row in df.iterrows():
 
    prompt = f"Please write a detailed article about {row['topic']}. Use this information to write the article: {row['context']}"
    response = openai.Completion.create(engine="text-davinci-003", prompt=prompt, temperature=0.7,max_tokens=2048,top_p=0.5)
    results.append([row['topic'], response.choices[0].text])

output_df = pd.DataFrame(results, columns = ['Topic', 'Generated Text'])

output_df.to_csv('output.csv', index=False)

In its basic form, the prompt will use the PAA answer as context to write the article. Assuming that the PAA answer that Google shows is accurate, the output generated using that as context should generate more accurate content.

Once again, YOU NEED TO CHANGE THE PROMPT. Please don't use this prompt because the output will be pathetic and short. The variable for the topic is {row['topic']} and the context is {row['context']}. Use these in your own prompt any way you see fit.

You need to customize your prompts for your specific niche. Ideally, you'd want custom prompts for each article but that takes too long when you're creating bulk content.

The output will be saved as a CSV.

Step 6: Use WP All Import

Use the WP All Import plugin to upload the content to your site. There are several tutorials that go over how you can do that. You can use some plugins for images etc.




That's pretty much it. It's super easy to get started. There are several ways to improve the output you get from OpenAI but I'm not going to get into that here.

You can also use this script for other types of content or for inserting researched data into a prompt.
Amazing post - SUPER helpful.

Question: how do you use SEO Minion to make sure your site ends up on the first page?
 
Amazing post - SUPER helpful.

Question: how do you use SEO Minion to make sure your site ends up on the first page?

I’m not sure what you mean. SEOMinion is a chrome extension that offers some additional functionality on the SERP. It’s not going to rank your page.
 
Has anyone figured out how to increase the word count of each article? Even after editing the prompt "The article must be a minimum of 750 words" It's still coming back with around 400 words. I've also tried changing the token limit etc.
 
Has anyone figured out how to increase the word count of each article? Even after editing the prompt "The article must be a minimum of 750 words" It's still coming back with around 400 words. I've also tried changing the token limit etc.

Prompts like one in your example are usually ignored.

There are ways to get longer content with a single prompt but you’ll get much better results if you create the content in sections.

First create a generic outline that will work for all the PAA keywords you’re targeting and then create the articles one section at a time.
 
You're complicating things and making it harder for yourself. It's really simple and you don't need to use Delimiters or anything else. The output generated by SEO Minion is a CSV. Just delete the columns you don't need and save them. If that doesn't work, just copy the entire column of text into a text editor if you have to and then stick it into Excel or whatever else you're using to export the CSV.

If you follow the instructions from the original post, you'll get it to work.

Here is an imgur short videolink showing how the original .csv file has no columns for me:
Should I replace my excel? Open it some other how?
 
Here is an imgur short videolink showing how the original .csv file has no columns for me:
Should I replace my excel? Open it some other how?

The gif is too quick so I can’t really tell what’s going on but I can see the column headers. So the columns look like they’re there.

You could also try opening them in Google Drive, Numbers or something else and see if that works.

This is the output from SEO Minion and as far as I know, the output file works correctly.
 
Hello, has anyone managed to get this working with gpt4 ? Seems like, gpt-4-0314 is only returning 1 line of text.
 
Hello, has anyone managed to get this working with gpt4 ? Seems like, gpt-4-0314 is only returning 1 line of text.

I haven’t used it yet. Let me look into it and I’ll update the script.
 
here is a head start of what I tried for gpt4:

Code:
for index, row in df.iterrows():

    messages = [
        {
            "role": "system",
            "content": "You are a helpful assistant that can write blog posts in the style of XXX."
        },
        {
            "role": "user",
            "content": f"Write a blog post about '{row['topic']}' with a humorous, clever, and educational tone. Include headings, subheadings, examples, tips, and analogies. Cover the following points: {row['context']}."
        },
        {
            "role": "user",
            "content": "Suggest a catchy SEO meta description of no more than 158 characters long."
        }
    ]

    response = requests.post(
        "https://api.openai.com/v1/chat/completions",
        headers={
            "Content-Type": "application/json",
            "Authorization": f"Bearer {openai.api_key}"
        },
        json={
            "model": "gpt-4-0314",
            "messages": messages,
            "temperature": 0.7,
            "max_tokens": 7600,
            "top_p": 0.5
        }
    ).json()

    results.append([row['topic'], response['choices'][0]['message']['content']])

output_df = pd.DataFrame(results, columns=['Topic', 'Generated Text'])

output_df.to_csv('xxxxxxx.csv', index=False)
[/code]

I also tried it with message in 1 var which returned empty results
 
So how are you making sure your page gets ranked first?

For these kind of sites, you don’t have to do much. Publish as many articles on the topic as possible and rewrite whatever ranks.
 
OK easy enough. Does your tutorial have anything about using PAA sites to generate revenue?

That’s up to you. There are several ways to monetise. It all depends on your niche and requirements.

Once you have the traffic, you can do whatever you like with it. Ads, affiliate, lead gen, e-books, courses, email lists, and hundreds of other things.
 
Back
Top