[Step-by-Step Guide] Find keywords, create and publish 150 articles to wordpress site in less than 30 minutes using GPTChat and Python/Google Colab

i use my own wordpress user id .. for the password I generate application password ... for example it has
Slla Ekl2 pfyb ... do I need to fix the gap between password

No this is fine
 
Paste but exactly like this: (all lines bellow should start at the same position - this is the indentation in python).
so import time i is just bellow title


Code:
    if e<begin_index or e>=end_index:continue #this makes sure we only add article from begin to end
    the_temperature = 0.7
    the_max_tokens = 2000
    all_params = akeyword,prefix,the_temperature,the_max_tokens
    print("we are writing post #",e,", using keyword:",akeyword)
    gptchat_article = gpt_chat(all_params)
    title = akeyword.title()
    import time
    time.sleep(20)
done ...still error
 

Attachments

  • SharedScreenshot.jpg
    SharedScreenshot.jpg
    161.6 KB · Views: 37
  • 2.jpg
    2.jpg
    111.1 KB · Views: 35
I see, you did not paste it correctly.

Here is the entire cell:

Code:
# SETTINGS
begin_index = 11
end_index = 12
your_site = "yur site url"
your_user = "your site username"
your_password = "your site application password"
wordpress_category = "" # or you can add here a category id
title_is_keyword = "yes" #cam be "yes" or "no". If yes then the title is the keyword, if no then the title is created by GPTCHAT
remove_ai_detection = "no"


#prefix = "Write an article about"
prefix = "Write a very extremelly long and detailed article about "
#load the fixed keywords
with open(file_with_keywords, 'r') as fyl:
    keywords = fyl.readlines()
keywords = [x.strip() for x in keywords]
 
#now we create posts using GPT-chat and post them to our wordpress site
for e,akeyword in enumerate(keywords):
 
    if e<begin_index or e>=end_index:continue #this makes sure we only add article from begin to end
    the_temperature = 0.7
    the_max_tokens = 2000
    all_params = akeyword,prefix,the_temperature,the_max_tokens
    print("we are writing post #",e,", using keyword:",akeyword)
    gptchat_article = gpt_chat(all_params)
    title = akeyword.title()
    import time
    time.sleep(20)
 
    try:
        gptchat_article_list = gptchat_article.split("\n")
        if gptchat_article_list[0].count(".")<=1 and gptchat_article_list[1].strip()=="":
            title = gptchat_article_list[0]
            gptchat_article = gptchat_article.replace(title,"").strip()
            if title_is_keyword=="yes":
                title = akeyword.title()
    except:pass
 
 
    #now we post to out wordpres site
    try:
        the_response = make_post(title,gptchat_article,your_user,your_password,your_site,wordpress_category)
        the_link = the_response['guid']['rendered']
        print("the_link",the_link,"word count",len(gptchat_article.split()),"the_title:",title)
    except Exception as err:
        print("we have an error",err)
 
I see, you did not paste it correctly.

Here is the entire cell:

Code:
# SETTINGS
begin_index = 11
end_index = 12
your_site = "yur site url"
your_user = "your site username"
your_password = "your site application password"
wordpress_category = "" # or you can add here a category id
title_is_keyword = "yes" #cam be "yes" or "no". If yes then the title is the keyword, if no then the title is created by GPTCHAT
remove_ai_detection = "no"


#prefix = "Write an article about"
prefix = "Write a very extremelly long and detailed article about "
#load the fixed keywords
with open(file_with_keywords, 'r') as fyl:
    keywords = fyl.readlines()
keywords = [x.strip() for x in keywords]
 
#now we create posts using GPT-chat and post them to our wordpress site
for e,akeyword in enumerate(keywords):
 
    if e<begin_index or e>=end_index:continue #this makes sure we only add article from begin to end
    the_temperature = 0.7
    the_max_tokens = 2000
    all_params = akeyword,prefix,the_temperature,the_max_tokens
    print("we are writing post #",e,", using keyword:",akeyword)
    gptchat_article = gpt_chat(all_params)
    title = akeyword.title()
    import time
    time.sleep(20)
 
    try:
        gptchat_article_list = gptchat_article.split("\n")
        if gptchat_article_list[0].count(".")<=1 and gptchat_article_list[1].strip()=="":
            title = gptchat_article_list[0]
            gptchat_article = gptchat_article.replace(title,"").strip()
            if title_is_keyword=="yes":
                title = akeyword.title()
    except:pass
 
 
    #now we post to out wordpres site
    try:
        the_response = make_post(title,gptchat_article,your_user,your_password,your_site,wordpress_category)
        the_link = the_response['guid']['rendered']
        print("the_link",the_link,"word count",len(gptchat_article.split()),"the_title:",title)
    except Exception as err:
        print("we have an error",err)
i delete the entire cell .. and copy your above code and pasted but still error
 

Attachments

  • SharedScreenshot.jpg
    SharedScreenshot.jpg
    191.5 KB · Views: 30
  • SharedScreenshot.jpg
    SharedScreenshot.jpg
    191.5 KB · Views: 29
This is just OpenAI credit error, maybe you spent all the credits. Check your account.
 
This is incredible bro thanks for sharing , I will try it out
 
did not work , it just ran but did not add any post to the website idk what is wrong . but have added all the info and showed no error . but did not post anything
 
did not work , it just ran but did not add any post to the website idk what is wrong . but have added all the info and showed no error . but did not post anything

Probably the website credentials are not correct.
 
Did you rank for any keyword ? how many articles and traffic just now ? Appreciated your effort to enrich our forum. Thanks a lot.
 
Did you rank for any keyword ? how many articles and traffic just now ? Appreciated your effort to enrich our forum. Thanks a lot.

Not yet, I shared it as soon as I wrote the code, so the posts are still not indexed.

From some discussion, it is possible that for better indexing of AI content it is better to have a domain with some authority. I still did not test it for example on sites such as weebly or WordPress but I am pretty sure it would work very well and rank faster than on a new domain.
 
Great set up and hack, time to fill some of my wordpress blogs
 
Back
Top