Best Prompt For SEO Content Writing?

First, id truly like to appreciate anyone who pays this thread attention!

I am new to coding and I made my first project using GPT to integrate with a WordPress plugin I am working on called “TurboBlogger”, which turns your entered Blog Title, Category, SEO Keywords, and Target Audience into an HTML-formatted blog post on WordPress.

As of right now, the OpenAI responses don’t include exactly what I am looking for (probably my fault. I also do not have GPT-4 API access so once I get that I assume that will help my situation, but for now, I really need help and your ideas to tweak my prompt to find the best prompt for content writing.

The End Goal: Perfectly formatted HTML WordPress blog post with H tags around headings, P tags around paragraphs, and UL/OL tags around lists (if needed). In addition, it would be very cool to see the response contain A Href backlinks to relevant blogs and even cooler if the response added images to the response. But, I don’t think my coding skills will allow that in the near future lol.

How do you suggest I tweak my prompt to get a better result?

My Current OpenAI Request:

$fields = array(
    'model' => $model,
    'messages' => array(
            'role' => 'system',
            'content' => 'You are an expert SEO-focused blog writer. Your task is to create the perfect blog post that ranks high on search engines and delivers valuable content to the reader. The blog you give must be HTML formatted with proper SEO structure. Including proper SEO h2,h3,h4 tags on headings and bullet point/lists HTML if they choose to be used. Write this blog for the target audience which is ' . $target_audience . ( ! empty( $call_to_action ) ? '. The call to action at the end of this blog below the summary is ' . $call_to_action . '.' : '' )
        array('role' => 'user', 'content' => 'The title of the blog you will write the content for is $title. The primary SEO keywords to focus on are $keywords. In the introduction, hook the reader and provide an overview of what the post offers. The body should cover subtitles with clear headings and provide core content that delivers on the promises made in the headline and introduction. Wrap up the post with a concise conclusion or summary of key points. $additional_requests.')

Try thinking about a prompt as if it was a landing page where you have to scroll for ages before you reach the end. Be as specific as possible.
A good prompt for SEO may take some weeks of research.

The model doesn’t work like “How to I heal cancer?” or “Show me how to solve an unsolved math problem”.

You will have to get all the informations on how to rank good (you can use crawlers for that and create the math behind it).

This is not a beginners show. The best SEO prompt in the world is probably worth multi millions.
I had a page in travel business on top for like 80k phrases once. It was hard dedicated work and the strategy was copied very fast.

So basically what you want is to fight Google’s AI with openAI :wink:

Come on!

1 Like

But! And that’s where ChatGPT will help you alot! You can use it as a tool to learn everything needed in a very structured way.

Ask the model what is important to write good content. Let it create a list.
Ask it to create a course on all topics of the list.
Ask it to create a youtube shorts script for each chapter and get yourself educated on the topic.

And eventually when your prompting technique gets better because you ask the right questions you may start creating a piece of artwork that will spit out good blogposts.

Educate yourself in prompting techniques such as multishots or chain of thoughts (if you are not a natural talent in asking the right questions to get the right informations).

And on top of that you might also use agent techniques to get answers from different perspectives.

Like from a search engine engineers point of view. Or from a customers view.

In the end the best blog post you can create is one that people read and instantly want to share.

1 Like

Thank you! That makes perfect sense. I really just haven’t put enough time into finding the best prompt yet.

1 Like

I tested with the prompt and it appears that you have to move "The blog you give must be HTML formatted with proper SEO structure. Including proper SEO h2,h3,h4 tags on headings and bullet point/lists HTML if they choose to be used. " into the user section.

The system section does work better with the update, but it’s still a “soft” recommendation. It works okay for picking target audience and defining the role as a blog writer.

Hard requests like formatting and title should be in user.

Also I agree with @jochenschultz some iteration helps a lot in improving quality. This is where the chat format helps. Instead of the user filling in some variables, you can have the bot interview and guide the user into making something better.

E.g. Have the bot ask the user what kind of audience they want to target. If asked to fill in a form, a human might say “18-28 y.o. male, young professional,” but this might not be exactly what they want. Is it selling comics? Perfumes? GPT might be better at figuring that out or even guide and offer suggestions.

1 Like

Here is my way of working it out in a WordPress Plugin: I hope you can get 1 or 2 things out of it.

The generate completion function

public function generate_completion($prompt, $args = array()) {
		$system_message = "The assistant is an experienced writer who produces detailed and informative (2000+ words) articles about the topic. The assistant must organize the content using Markdown formatting, specifically the CommonMark syntax.";

		if ($this->model == 'gpt-4' || $this->model == 'gpt-3.5-turbo-16k') {
			// Chat Model
			$messages = array(
					"role" => "system", 
					"content" => $system_message
				array("role" => "user", "content" => $prompt)
			$body = array('messages' => $messages);
			return $this->generate('chat', $body, $args);

		} else {
			// Traditional model: use prompt
			return $this->generate('completion', array('prompt' => $prompt), $args);

The Prompt will be something like:

private function generate_content($keyword, $args) {
        // We get the article from AI
        $prompt = sprintf("Write a 2000-word SEO-optimized article about '%s'. Begin with a catchy, SEO-optimized level 1 heading (`#`) that captivates the reader. Follow with SEO optimized introductory paragraphs. Then organize the rest of the article into detailed heading tags (`##`) and lower-level heading tags (`###`, `####`, etc.). Include detailed paragraphs under each heading and subheading that provide in-depth information about the topic. Use bullet points, unordered lists, bold text, underlined text, code blocks etc to enhance readability and engagement.", $keyword);
        $content = $this->ai_generator->generate_completion($prompt, $args);
        // Extract the title from the first level 1 heading
        preg_match('/^#\s+(.*)$/m', $content, $matches);
        $title = $matches[1];

        // Check if the title contains asterisks at the beginning or end, and remove them if found
        if (strpos($title, '*') !== false) {
            $title = preg_replace('/^\*+|\*+$/', '', $title);

        $content = preg_replace('/^#\s+.*$\n/m', '', $content);
        return array('title' => $title, 'content' => $content);

With that code, I get the response (Always) in Markdown format with all the heading tags, tables, bullet points etc.

Then I use Common Mark to parse markdown into HTML, which produces well-written and formatted articles.

NOTE: I have gpt-4 access but prefer gpt-3.5-turbo-16k, which provides longer responses and is way cheaper. I have gotten over 2500 responses in various articles.

I am still tweaking the prompts to get better content.

1 Like

Wish I could understood this lol xD, is this a fine-tuning function bro ?

The gateway to understanding is using your attention heads to key particular semantic elements of the provided documentation that define the scope of the task, such as “in a WordPress Plugin

paste into an AI and see how it does:

complete this php wordpress function:

generate_completion($prompt, $args = array()) {
    // Wordpress plugin for calling the OpenAI completions API to ask a user question and get an AI response
    // This is a feature that can be added to any posts for blog readers to use 

Here is my SEO-ready framework and usage comments. Please let us know if you need help.

  1. “Write a 2000-word blog post in a friendly and encouraging tone.”
    • COMMENTS: Specify the desired length of the blog post and the tone you want the content to have. This could be formal, conversational, authoritative, friendly, etc. depending on your audience and the purpose of your content.
  2. “The topic is ‘The Future of Renewable Energy.’ The target audience is environmentally-conscious consumers interested in technology.”
    • COMMENTS: Provide the specific topic of the blog post and identify the target audience. This will help tailor the content to the interests and knowledge level of your readers.
  3. “Use the AIDA and SCQA frameworks and use ‘Renewable Energy,’ ‘Solar Power,’ and ‘Wind Energy’ as the primary keywords.”
    • COMMENTS: Indicate any specific writing frameworks or structures you want to be used, such as AIDA, SCQA, or others. Also, list the SEO keywords that should be included in the blog post.
  4. “In the ‘Interest’ section of the AIDA framework, make sure to include some surprising statistics about renewable energy from credible sources to pique the reader’s interest.”
    • COMMENTS: For each section of your chosen writing framework, give specific instructions about what kind of information, anecdotes, or data should be included.
  5. “Break up the content with subheadings for each new topic or idea.”
    • COMMENTS: Specify the use of subheadings, bullet points, numbered lists, or other formatting tools to improve readability.
  6. “Include a ‘how-to’ section explaining how readers can transition to using renewable energy in their own homes.”
    • COMMENTS: If you want to include certain types of content, such as lists, how-to advice, case studies, or comparisons, mention that in your prompt.
  7. “End the post with a summary of the key points and a compelling question to encourage reader engagement and discussion.”
    • COMMENTS: Specify how you want the blog post to be concluded. This could be a summary, a teaser for the next post, a call-to-action (CTA), a question to encourage comments, or something else.
  8. “For visual aids, specify places where an illustrative image or a diagram could be beneficial, for example when explaining how different types of renewable energy work or comparing their benefits.”
    • COMMENTS: If there are specific diagrams, images, infographics, or videos that should be included in the blog post, mention it in the prompt.
  9. “Format the blog post in markdown. Remember to use H1 for the title, H2 for main subheadings, and H3 for any sub-points or sub-categories.”
    • COMMENTS: Indicate the formatting requirements for the blog post. This could include markdown, HTML, or just plain text, and could specify use of headings, bold or italic text, bullet points, numbered lists, etc.